当前位置:   article > 正文

c#调用QQ开启临时会话

c#调用qq
 public void StartQQ(string QQ)
        {
            var openkey64 = @"SOFTWARE\Wow6432Node\Tencent\QQ2009";
            var openkey32 = @"SOFTWARE\Tencent\QQ2009";
            var openkeyTim64 = @"SOFTWARE\Wow6432Node\Tencent\TIM";

            var qqPath = "";
            RegistryKey reg64 = Registry.LocalMachine.OpenSubKey(openkey64);
            RegistryKey reg32 = Registry.LocalMachine.OpenSubKey(openkey32);
            RegistryKey regTim32 = Registry.LocalMachine.OpenSubKey(openkeyTim64);

            if (reg64 != null)
            {
                qqPath = reg64.GetValue("Install").ToString();
            }
            else if (reg32 != null)
            {
                qqPath = reg32.GetValue("Install").ToString();
            }
            else if (regTim32 != null)
            {
                qqPath = regTim32.GetValue("Install").ToString();
            }


            if (!string.IsNullOrWhiteSpace(qqPath))
            {
                var dizhi1 = qqPath + @"\Bin\Timwp.exe";
                var arg = "tencent://message/?uin=" + QQ;
                Process.Start(dizhi1, arg);
                //ThisHidden();
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("未检测到安装QQ");
            }
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号