我试图修复一种检查用户是否在其计算机上安装了Skype的方法。我修理了这个问题:
有没有人对如何检查计算机上是否安装了Skype有任何想法?
我使用的方法是对此的方法:
答案 0 :(得分:6)
只需使用注册表:
using Microsoft.Win32;
//Function uses Microsoft.Win32 to check registry value of
//HKEY_CURRENT_USERSoftwareSkypePhoneSkypePath and returns false if
//the key is null
private bool isSkypeUser()
{
RegistryKey skype = Registry.CurrentUser.OpenSubKey(@"SoftwareSkypePhone");
if (skype != null && skype.GetValue("SkypePath") != null)
{
return true;
}
else
{
return false;
}
}
http://brcline.com/blog/?tag=skype
修改强>
一个肮脏的解决方法是遍历StartMenu文件夹,查找Skype快捷方式或文件夹。您必须使用以下SpecialFolder枚举:
var startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonPrograms)
希望它有所帮助!