VB中判断.NET3.5是否安装

前端之家收集整理的这篇文章主要介绍了VB中判断.NET3.5是否安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  • OptionExplicit
  • DimhRAsLong
  • PrivateConstHKEY_LOCAL_MACHINE=&H80000002
  • PrivateDeclareFunctionRegOpenKeyLib"advapi32.dll"Alias"RegOpenKeyA"(ByValhKeyAsLong,ByVallpSubKeyAsString,phkResultAsLong)AsLong
  • PrivateDeclareFunctionRegQueryValueExLib"advapi32.dll"Alias"RegQueryValueExA"(ByValhKeyAsLong,ByVallpValueNameAsString,ByVallpReservedAsLong,lpTypeAsLong,lpDataAsAny,lpcbDataAsLong)AsLong'NotethatifyoudeclarethelpDataparameterasString,youmustpassitByValue.
  • PrivateSubCommand1_Click()
  • RegOpenKeyHKEY_LOCAL_MACHINE,"SOFTWARE/Microsoft/.NETFramework/v2.0.50727/NGENService/ListenedState",hR'这里是项名
  • DimrAsLong
  • r=RegQueryValueEx(hR,"RootstoreDirty",0)
  • Ifr=2Then
  • MsgBox"不存在"
  • Else
  • MsgBox"存在"
  • EndIf
  • EndSub
  • 猜你在找的VB相关文章