<script>
var WshShell = new ActiveXObject("WScript.Shell");
var WshSysEnv = WshShell.Environment("System");
alert(WshSysEnv("NUMBER_OF_PROCESSORS"));
alert(WshSysEnv("PROCESSOR_ARCHITECTURE"));
alert(WshSysEnv("PROCESSOR_LEVEL"));
alert(WshSysEnv("PROCESSOR_REVISION"));
</script>
var WshShell = new ActiveXObject("WScript.Shell");
var WshSysEnv = WshShell.Environment("System");
alert(WshSysEnv("NUMBER_OF_PROCESSORS"));
alert(WshSysEnv("PROCESSOR_ARCHITECTURE"));
alert(WshSysEnv("PROCESSOR_LEVEL"));
alert(WshSysEnv("PROCESSOR_REVISION"));
</script>
但都是比较安全的,
不可能偷偷得到的
<script>
var WshShell = new ActiveXObject("WScript.Shell");
var WshSysEnv = WshShell.Environment("Process");
alert(WshSysEnv("COMSPEC"));
alert(WshSysEnv("PATH"));
alert(WshSysEnv("PROMPT"));
alert(WshSysEnv("WINDIR"));
alert(WshSysEnv("TEMP"));
alert(WshSysEnv("TMP"));
</script>
System Microsoft Windows NT/2000
Process Windows 95/98/Me 但好像安全问题是绕不过去了…