我试图修复一种方法,检查用户是否在他的计算机上安装了Skype.这个我修复/提出:
有没有人对如何检查计算机上是否安装了Skype有任何想法?
我使用的方法是这个方法的simillrar:
只需使用注册表:
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;
}
}
Run Code Online (Sandbox Code Playgroud)
http://brcline.com/blog/?tag=skype
编辑:
一个肮脏的解决方法是遍历StartMenu文件夹,查找Skype快捷方式或文件夹.您必须使用以下SpecialFolder枚举:
var startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonPrograms)
Run Code Online (Sandbox Code Playgroud)
希望能帮助到你!
归档时间: |
|
查看次数: |
2758 次 |
最近记录: |