日期:2014-05-17 浏览次数:20512 次
script type="text/javascript"> // .net 版本号 function window::onload(){ if (HasRuntimeVersion(dotNETRuntimeVersion)){ result.innerHTML = "已经安装了 .NET Framework " + dotNETRuntimeVersion }else{ result.innerHTML = "没有安装 .NET Framework " + dotNETRuntimeVersion + ".</font>"; } //result.innerText += "\n\n本电脑的User-Agent为 : " + // navigator.userAgent + "."; } function HasRuntimeVersion(versionToCheck){ var userAgentString = navigator.userAgent.match(/.NET CLR [0-9.]+/g); if (userAgentString != null){ var i; for (i = 0; i < userAgentString.length; ++i){ if (CompareVersions(GetVersion(versionToCheck), GetVersion(userAgentString[i])) <= 0) return true; } } return false; } function GetVersion(versionString){ var numericString = versionString.match(/([0-9]+)\.([0-9]+)\.([0-9]+)/i); return numericString.slice(1); } function CompareVersions(version1, version2){ for (i = 0; i < version1.length; ++i){ var number1 = new Number(version1[i]); var number2 = new Number(version2[i]); if (number1 < number2) return -1; if (number1 > number2) return 1; } return 0; } </script>