<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
var shell = new ActiveXObject("WScript.Shell");
function read()
{
//读注册表值
var key1= shell.RegRead("HKEY_CURRENT_USER\\Test\\hello");
window.alert(key1);
}
function del()
{
//删除注册表项
shell.RegDelete("HKEY_CURRENT_USER\\Test\\hello");
alert("写入成功");
}
function writen()
{
//往注册表中写入值
shell.RegWrite ("HKEY_CURRENT_USER\\Test\\hello","柳晛","REG_SZ");
alert("写入成功")
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<label>
<input type="button" name="btn1" value="读取" onClick="read()">
<input type="button" name="btn2" value="删除" onClick="del()">
<input type="button" name="btn3" value="写入" onClick="writen()">
</label>
</form>
</body>
</html>