如何检测电脑是否安装了.net framework

王朝c#·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

检查/%windir%/System32/下面是否含有MSCOREE.DLL文件如果有就所名已经安装了FM

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy下可以检查到机器上安装了那些版本的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 = "Software\Microsoft\.NETFramework"

If .DoesKeyExist() Then

.KeyPath = "Software\Microsoft\.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.3705\mscorlib.dll")

Case dnfvV1_1

o_blnRet = .DoesFileExistEx(o_strRet & "v1.1.4322\mscorlib.dll")

Case dnfvVAny

o_blnRet = .DoesFileExistEx(o_strRet & "v1.0.3705\mscorlib.dll")

If o_blnRet Then

Else

o_blnRet = .DoesFileExistEx(o_strRet & "v1.1.4322\mscorlib.dll")

End If

End Select

End With

Else

End If

Else

o_blnRet = False

End If

End With

DoesDotNETFrameworkExist = o_blnRet

End Function

[url=http://dev.csdn.net/javascript:__doPostBack(][/url]

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