c#调起qq临时回话

           var openKey64 = @"SOFTWARE\Wow6432Node\Tencent\QQ2009";
            var openKey32 = @"SOFTWARE\Tencent\QQ2009";
            var openTim64 = @"SOFTWARE\Wow6432Node\Tencent\TIM";
            var qqPath = "";
            RegistryKey reg64 = Registry.LocalMachine.OpenSubKey(openKey64);
            RegistryKey reg32 = Registry.LocalMachine.OpenSubKey(openKey32);
            RegistryKey regTim = Registry.LocalMachine.OpenSubKey(openTim64);
            if (reg64 != null)
            {
                qqPath = reg64.GetValue("Install").ToString();
            }
            else if (reg32 != null)
            {
                qqPath = reg32.GetValue("Install").ToString();
            }
            else {
                qqPath = regTim.GetValue("Install").ToString();
            }
            if (!string.IsNullOrEmpty(qqPath))
            {
                var address = qqPath + @"\Bin\Timwp.exe";
                var arg = "tencent://message/?uin=qq号";
                Process.Start(address, arg);
            }
            else {
                Console.WriteLine("未检测qq程序");
            }

  记录。

原文:https://blog.csdn.net/weixin_43563837/article/details/109164671

posted @ 2021-09-24 11:26  绯颜旧雨  阅读(70)  评论(0编辑  收藏  举报