用js获取本地电脑信息(但是只能在IE浏览器下才行,其他浏览器其获取不到的): 复制代码 代码如下: ieTest <br>window.onload = getusername; <br>function getusername(){ <br>//js获取电脑信息 <br>var WshNetwork = new ActiveXObject("WScript.Network"); <br>var WshShell = new ActiveXObject ("WScript.Shell"); <br>var $lDomain = document.getElementById('lDomain'), <br>$lcName = document.getElementById('lcName'), <br>$luName = document.getElementById('luName'), <br>$lDomainDn = document.getElementById('lDomainDn'); <br>$lDomain.value =WshNetwork.UserDomain; <br>$lcName.value =WshNetwork.ComputerName; <br>$luName.value =WshNetwork.UserName; <br>$lDomainDn.value =WshShell.RegRead ("HKCU\Volatile Environment\USERDNSDOMAIN"); <br>WshNetwork = null; <br>WshShell = null; <br>}; <br><br>