首页 > 编程 > .NET > 正文

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

2024-07-10 12:59:03
字体:
来源:转载
供稿:网友


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



发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表