当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > 如何检测电脑是否安装了.net framework

ASP.NET
FreeTextBox(版本3.1.6)在ASP.Net 2.0中使用方法
.NET 常用功能和代码小结
在 .NET Framework 2.0 中未处理的异常导致基于 ASP.NET 的应用程序意外退出
asp.net IList查询数据后格式化数据再绑定控件
asp.net sql存储过程
asp.net 简单实现禁用或启用页面中的某一类型的控件
asp.net(c#)获取内容第一张图片地址的函数
The remote procedure call failed and did not execute的解决办法
ASP.NET 在线文件管理
asp.net 读取并修改config文件实现代码
ASP.NET Cookie 操作实现
asp.net Silverlight中的模式窗体
Silverlight中动态获取Web Service地址
asp.net Silverlight应用程序中获取载体aspx页面参数
asp.net 水晶报表隔行换色实现方法
asp.net 获取Gridview隐藏列的值
手动把asp.net的类生成dll文件的方法
asp.net 使用ObjectDataSource控件在ASP.NET中实现Ajax真分页
动态指定任意类型的ObjectDataSource对象的查询参数
asp.net Md5的用法小结

ASP.NET 中的 如何检测电脑是否安装了.net framework


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 60 ::
收藏到网摘: n/a

检查/%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