我试图在Internet Explorer中运行这个vbscript,但它似乎不起作用。它可以在我制作.vbs文件并双击时运行,但不能在浏览器上运行。如何在Internet Explorer中运行vbs
Dim strWebsite
strWebsite = "www.site.org"
If PingSite(strWebsite) Then
WScript.Echo "Web site " & strWebsite & " is up and running!"
Else
WScript.Echo "Web site " & strWebsite & " is down!!!"
End If
Function PingSite(myWebsite)
Dim intStatus, objHTTP
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
objHTTP.Open "GET", "http://" & myWebsite & "/", False
objHTTP.SetRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MyApp 1.0; Windows NT 5.1)"
On Error Resume Next
objHTTP.Send
intStatus = objHTTP.Status
On Error Goto 0
If intStatus = 200 Then
PingSite = True
Else
PingSite = False
End If
Set objHTTP = Nothing
End Function
这样做的正确方法是什么?
为什么这个标签为'javascript'?你可以在你输入这个文件的地方显示你的html代码吗? – jasonscript 2014-11-06 02:07:36