C#获取QQ安装路径,百度了几个小时,才搞清楚咋用(因为我不会).QQPath就是输出的路径所在变量

功能建议 · 205 次浏览
瞑空凌 创建于 2023-03-20 21:40

//.cs  文件类型,便于外部编辑时使用
// 引用必要的命名空间
using Microsoft.Win32;

// Quicker将会调用的函数
public static void Exec(Quicker.Public.IStepContext context)
{
    //var oldValue = context.GetVarValue("varName");  // 读取动作里的变量值
    //MessageBox.Show(oldValue as string);
    //context.SetVarValue("varName", "从脚本输出的内容。"); // 向变量里输出值
    //MessageBox.Show("Hello World!");
     object objResult = new object();
    RegistryKey hkSoftWare = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Tencent\PlatForm_Type_List\1",false);
    objResult = hkSoftWare.GetValue("TypePath");
    hkSoftWare.Close();
    context.SetVarValue("QQPath", objResult.ToString());
    //MessageBox.Show(objResult.ToString());
}


回复内容
暂无回复
回复主贴