用js获取本地电脑信息(但是只能在IE浏览器下才行,其他浏览器其获取不到的):
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ieTest</title>
<script type="text/javascript">
window.onload = getusername;
function getusername(){
//js获取电脑信息
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>
</head>

<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>
</html>
标签:
js获取,电脑信息

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com

评论“用js获取电脑信息(是使用与IE浏览器)”

暂无“用js获取电脑信息(是使用与IE浏览器)”评论...