如何检测电脑是否安装了.net framework
发表于:2007-06-30来源:作者:点击数:
标签:
检查/%windir%/System32/下面是否含有MSCOREE.DLL文件如果有就所名已经安装了FM HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETFrameworkpolicy下可以检查到机器上安装了那些版本的FM 具体函数: Public Function DoesDotNETFrameworkExist(ByVal udeVersion As Dot
检查/%windir%/System32/下面是否含有MSCOREE.DLL文件如果有就所名已经安装了FM
HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETFrameworkpolicy下可以检查到机器上安装了那些版本的FM
具体函数:
Public Function DoesDotNETFrameworkExist(ByVal udeVersion As DotNETFrameworkVersions) As Boolean
Dim o_blnRet As Boolean
Dim o_strRet As String
With New cRegistry
.hKey = HKEY_LOCAL_MACHINE
.KeyPath = "SoftwareMicrosoft.NETFramework"
If .DoesKeyExist() Then
.KeyPath = "SoftwareMicrosoft.NETFramework"
o_strRet = GetRegValue(.GetRegistryValue("InstallRoot", ""))
o_blnRet = (o_strRet <> "")
If o_blnRet Then
With New cFileFuncs
Select Case udeVersion
Case dnfvV1
o_blnRet = .DoesFileExistEx(o_strRet & "v1.0.3705mscorlib.dll")
Case dnfvV1_1
o_blnRet = .DoesFileExistEx(o_strRet & "v1.1.4322mscorlib.dll")
Case dnfvVAny
o_blnRet = .DoesFileExistEx(o_strRet & "v1.0.3705mscorlib.dll")
If o_blnRet Then
Else
o_blnRet = .DoesFileExistEx(o_strRet & "v1.1.4322mscorlib.dll")
End If
End Select
End With
Else
End If
Else
o_blnRet = False
End If
End With
DoesDotNETFrameworkExist = o_blnRet
End Function
原文转自:http://www.ltesting.net