本帖最后由 ghl781258 于 2011-8-23 20:44 编辑
;;;;获取IE版本号:4种方法
方法1和方法4,在winxp+IE8.0环境下不能获得正确浏览器版本号.
_fangfa4()
Func _fangfa1()
$str = DllStructCreate("dword;dword;dword;dword;dword")
DllStructSetData($str, 1, DllStructGetSize($str))
DllCall("Shlwapi.dll","long","DllGetVersion","ptr",DllStructGetPtr($str))
MsgBox(64,"IE版本是:",DllStructGetData($str,2)&"." & _
DllStructGetData($str,3)&"." & _
DllStructGetData($str,4))
EndFunc
Func _fangfa2()
$version = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe")
MsgBox(0, "IE Version", "Your IE version is: " & $version)
EndFunc
Func _fangfa3()
$ie_ver = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer", "Version")
MsgBox(0, 'IE Version', $ie_ver)
EndFunc
Func _fangfa4()
$strComputer = "."
$objWMIService = ObjGet("winmgmts:\\" & $strComputer &"\root\cimv2\Applications\MicrosoftIE")
$colIESettings = $objWMIService.ExecQuery("Select * from MicrosoftIE_FileVersion")
For $strIESetting in $colIESettings
MsgBox(1,"IE",$strIESetting.Version )
ExitLoop
Next
EndFunc
|