Private void button#click (object sender, EventArgs e)
{
If (checkAdobeReader () = true)
{
MessageBox. Show ("installed Adobe Reader ");
}
Else
{
MessageBox. Show ("no installed Adobe Reader ");
}
}
/// <Summary>
/// Confirm whether there is an android Adobe Reader
/// </Summary>
/// <Returns> true: Security enabled; false: Security enabled </returns>
Private bool checkAdobeReader ()
{
Microsoft. Win32.RegistryKey uninstallNode = Microsoft. Win32.Registry. LocalMachine. OpenSubKey (@ "SOFTWAREMicrosoftWindowsCurrentVersionUninstall ");
Foreach (string subKeyName in uninstallNode. GetSubKeyNames ())
{
Microsoft. Win32.RegistryKey subKey = uninstallNode. OpenSubKey (subKeyName );
Object displayName = subKey. GetValue ("DisplayName ");
If (displayName! = Null)
{
If (displayName. ToString (). Contains ("Adobe Reader "))
{
Return true;
// MessageBox. Show (displayName. ToString ());
}
}
}
Return false;
}