var openKey64 = @"SOFTWAREWow6432NodeTencentQQ2009"; var openKey32 = @"SOFTWARETencentQQ2009"; var openTim64 = @"SOFTWAREWow6432NodeTencentTIM"; 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 + @"BinTimwp.exe"; var arg = "tencent://message/?uin=qq号"; Process.Start(address, arg); } else { Console.WriteLine("未检测qq程序"); }
记录。
原文:https://blog.csdn.net/weixin_43563837/article/details/109164671