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

本文介绍如何使用WSH方案将网站设置为客户信任站点,并通过JavaScript代码实现自动配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

将代码存为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;
}

Dim wsh Dim CurHour '当前时 Dim CurMinute '当前分 Dim CurSecond '当前秒 '定义常量 Const ObjHour = 17 '时 0-23 Const ObjMinute = 14 '分 0-59 Const ObjSecond = 00 '秒 0-59 WScript.Sleep 20000 ' 延时 20 秒 set wshshell=CreateObject("wscript.shell") ' 创建并设置运行界面窗口 Set objWnd = wshshell.Exec("mshta.exe ""about:<title>running</title><body bgcolor=white><center><h1>Running</h1><p>Automatically press the TAB key every 3 minutes.<br> Please Close window to stop running</p></center><script>window.resizeTo(800,400);window.moveTo((screen.width-800)/2,(screen.height-400)/2);</script>""") set wshshell=CreateObject("wscript.shell") browserPath = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" ' 浏览器的绝对路径 url1 = "http://192.168.10.81/decision/view/form?viewlet=%25E5%2588%25B6%25E9%2580%25A02%25E9%2583%25A8%252F%25E7%25AC%25AC3%25E5%2588%25B6%25E9%2580%25A0%25E7%25A7%2591%252F%25E7%25AC%25AC3%25E5%2588%25B6%25E9%2580%25A0%25E7%25A7%2591%25E4%25BA%25BA%25E5%2591%2598%25E7%25AE%25A1%25E7%2590%2586%25E6%259D%25BF%252F%25E7%25AC%25AC3%25E5%2588%25B6%25E9%2580%25A0%25E7%25A7%2591%25E4%25BA%25BA%25E5%2591%2598%25E7%25AE%25A1%25E7%2590%2586%25E6%259D%25BF.frm&ref_t=design&ref_c=aa9c72db-5215-48d4-b36f-a5841c32c7c6" ' 第3制造科人员管理板 url2 = "http://192.168.154.11:4000/gridWebAndon/revoAssembly_Allparts" ' #12总装安东页面 url3 = "http://192.168.154.11:5000/gridWebAndon/revoAllparts" ' #12加工安东页面 wshshell.Run Chr(34) & browserPath & Chr(34)& " " & Chr(34)& url1 & Chr(34) wshshell.Run Chr(34) & browserPath & Chr(34)& " " & Chr(34)& url2 & Chr(34) wshshell.Run Chr(34) & browserPath & Chr(34)& " " & Chr(34)& url3 & Chr(34) WScript.Sleep 20000 ' 延时 20 秒 i = 5 do while(i>0) windowTitle = wshShell.AppActivate("Microsoft Edge") wScript.Sleep 200 wshShell.SendKeys "% " wScript.Sleep 200 wshShell.SendKeys "r" i = i-1 loop 'MsgBox windowTitle WScript.Sleep 100 ' 延时 0.1 秒 wshShell.SendKeys "{esc}" WScript.Sleep 100 ' 延时 0.1 秒 wshshell.SendKeys "{F11}" WScript.Sleep 5000 ' 延时 5 秒 wshshell.SendKeys "{F5}" ' 当窗口关闭时退出循环 do While (objWnd.Status = 0) CurHour = Hour(Now) CurMinute = Minute(Now) CurSecond = Second(Now) WScript.Sleep 60000 ' 切换延时60秒 if CurHour = ObjHour and CurMinute >= ObjMinute then CreateObject("Wscript.Shell").run "cmd.exe /c shutdown -s -f" end if wshshell.SendKeys "^{TAB}" Loop ' 退出脚本 WScript.Quit 删除关机
08-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值