明辉手游网中心:是一个免费提供流行视频软件教程、在线学习分享的学习平台!

将你的网站设置为客户的信任网站--WSH方案

[摘要]将代码存为TrustedSite.js,在客户端执行 var SiteName="Acmnet"SetTrustSite(SiteName);WScript.Echo("...
将代码存为TrustedSite.js,在客户端执行

var SiteName="Acmnet"
SetTrustSite(SiteName);
WScript.Echo("You have accept 'http://acmnet/' as your Trusted Site");


function SetTrustSite(StrSiteName)
{
var WshShell=WScript.CreateObject("WScript.Shell");
WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Domains\\"+StrSiteName+"\\http", 2 ,"REG_DWORD");
TrustedSite_Value=WshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Domains\\"+StrSiteName+"\\http");
delete WshShell;
}