- 论坛徽章:
- 0
|
以下是网页代码
<html>
<head>
<script language="javascript">
document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent></APPLET>");
function set_proxy(){
try{
a1=document.applets[0];
alert("begin1111");
//注册ACTIVEX
a1.setCLSID("(f935dc22-1cf0-11d0-adb9-00c04fd58a0b}");
//a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");
alert("begin2222");
//建立实例
a1.createInstance();
alert("begin3333");
Shl = a1.GetObject();
alert("begin4444");
a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");
alert("begin5555");
try{
alert("begin66");
Shl.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable","00000001","REG_DWORD");
Shl.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\proxyserver","10.21.84.117:8080","REG_sz");
Shl.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Proxyoverride","10.*.*.*;9.*.*.*","REG_sz");
}
catch(e){
}
}
catch(e){}}
function unset_proxy()
{
alert("unset");
}
</script>
</head>
<body>
<form>
<input type=button value="设置代理" onclick=set_proxy()>
<input type=button value="取消设置" onclick=unset_proxy()>
</form>
</body>
</html>
执行结果是只能见到begin1111,说明注册Windows Script Host Shell Object没有成功.
请高手指点一二
[ 本帖最后由 femerry 于 2008-2-28 11:19 编辑 ] |
|