Use JS to obtain local computer information (but only in IE browser, other browsers can not get the):
Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>ieTest</title>
<script type= "Text/javascript" >
Window.onload = GetUserName;
function GetUserName () {
JS Access to Computer information
var wshnetwork = new ActiveXObject ("Wscript.Network");
var WshShell = new ActiveXObject ("Wscript.Shell");
var $lDomain = document.getElementById (' Ldomain '),
$lcName = document.getElementById (' Lcname '),
$luName = document.getElementById (' Luname '),
$lDomainDn = document.getElementById (' Ldomaindn ');
$lDomain. Value =wshnetwork.userdomain;
$lcName. Value =wshnetwork.computername;
$luName. Value =wshnetwork.username;
$lDomainDn. Value =wshshell.regread ("Hkcu\\volatile environment\\userdnsdomain");
WSHNetwork = null;
WshShell = null;
};
</script>
<body>
<input type= ' text ' id= ' ldomain ' value= '/>
<input type= ' text ' id= ' lcname ' value= '/>
<input type= ' text ' id= ' luname ' value= '/>
<input type= ' text ' id= ' ldomaindn ' value= '/>
</body>