Skip to content

Instantly share code, notes, and snippets.

@greatcodeeer
Last active August 16, 2020 09:57
Show Gist options
  • Save greatcodeeer/d2c41173e0e580adbbb4 to your computer and use it in GitHub Desktop.
Save greatcodeeer/d2c41173e0e580adbbb4 to your computer and use it in GitHub Desktop.
C# 检测是否已经安装Winrar
static public bool ExistsWINRAR()
{
try
{
RegistryKey the_Reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Win11RAR.exe");
return !string.IsNullOrEmpty(the_Reg.GetValue("").ToString());
}
catch
{
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment