我对这种语言相当熟悉,但这个概念对我来说是个谜。我想检查运行脚本的服务器是否可以访问互联网进行开发,所以假设我是否只是在我自己的服务器上离线工作,除了互联网访问之外我需要的一切。赶上我的漂移?谢谢你。
问问题
867 次
3 回答
0
您可以尝试像这样 ping 一个站点:(未测试)
url = "www.google.com"
Set objWShell = CreateObject("WScript.Shell")
Set objCmd = objWShell.Exec("ping " & url)
strPingResult = objCmd.StdOut.Readall()
set objCmd = nothing
set objWShell = nothing
strStatus = "offline"
if InStr(strPingResult,"TTL=") > 0 then strStatus = "online"
response.write url & " is " & strStatus
response.write ".<br>" & replace(strPingResult,vbCrLf,"<br>")
于 2012-06-26T19:58:50.433 回答
0
不确定我是否理解正确,但您可以使用Session对象/Global.asa文件 >Session_OnStart
并Session_OnEnd
为此。
于 2012-06-26T23:55:51.487 回答
0
查看我在这个非常相似的问题上发布的答案:
于 2013-02-08T05:13:07.527 回答