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");
}
}
07-31
215
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)