VB.Net遍历已安装的程序卸载信息

王朝学院·作者佚名  2016-08-27
窄屏简体版  字體: 小  |  中  |  大  |  超大  

1PRivateSharedFunctionProgramExists(ByValpgNameAsString)AsBoolean2DimtempAsString=Nothing3DimtempTypeAsString=Nothing4DimdisplayNameAsObject=Nothing5DimuninstallStringAsObject=Nothing6DimreleaseTypeAsObject=Nothing7DimcurrKeyAsRegistryKey =Nothing8DimsoftNumAsInteger=09Dimpregkey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Uninstall")10Dimresult =False11Try12ForEachitemAsStringInpregkey.GetSubKeyNames()13currKey =pregkey.OpenSubKey(item)14displayName = currKey.GetValue("DisplayName")15uninstallString = currKey.GetValue("UninstallString")16releaseType = currKey.GetValue("ReleaseType")17DimisSecurityUpdate =False18IfreleaseTypeIsNotNothingThen19tempType =releaseType.ToString()20IftempType ="Security Update"OrElsetempType ="Update"Then21isSecurityUpdate =True22EndIf23EndIf24If(NotisSecurityUpdate)AndAlso_25(displayNameIsNotNothing)AndAlso_26(uninstallStringIsNotNothing)AndAlso27displayName = pgNameThen28result =True29ExitFor30EndIf31Nextitem32Catch33Finally34pregkey.Close()35EndTry36Returnresult37End Function

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航