用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>$luName = document.getElementById('luName'), <BR>$ lDomainDn = document.getElementById('lDomainDn'); <BR>$lDomain.value =WshNetwork.UserDomain; <BR>$lcName.value =WshNetwork.ComputerName; <BR>$luName.value =Wshue.UserNetwork.ComputerName; <BR>$luName.value =Wsh0.UserNetwork. $lDomainDn.value =WshShell.RegRead ("HKCU\Volatile Environment\USERDNSDOMAIN"); <BR>WshNetwork = null; <BR>WshShell = null; <br>}; > <br><BR><body> <br><input type='text' id='lDomain' value='' /> <br><input type='text' id='lcName' value='' /> <BR><input type='text' id='luName' value='' /> <BR><input type='text' id='lDomainDn' value='' /> <BR> <BR>