2009-09-24 63 views

回答

0

這樣的事情?

Dim ie 
Set ie = CreateObject("internetexplorer.app location") 
ie.Navigate "http://www.mysite.com/mypage.aspx?q=1" 
ie.Visible=True 

Set WshShell = WScript.CreateObject("WScript.Shell") 
WshShell.Run "iexplore http://www.mysite.com/mypage.aspx?q=1", 9 
WScript.Sleep 10000 ' Give ie some time to load 

'Close the browser 
WshShell.SendKeys "%F" 
WshShell.SendKeys "C" 

,或者你直接從任務計劃運行網頁和使用curl

+0

有沒有辦法做到這一點,而無需啓動資源管理器?請記住這兩個文件(vbs和aspx)在同一臺機器上。 謝謝。使用curl然後 – Assaf 2009-09-24 12:32:05

+0

......你所做的一切只是改變.RUN「捲曲」和選項... – balexandre 2009-09-24 13:25:33

0

您可以使用ServerXMLHTTP的

rebember: -

dim xhr : set xhr = CreateObject("MSXML2.ServerXMLHttp.3.0") 
xhr.open "GET", "http://yoursite/youcode.ashx?params=x", false 
xhr.send 
if xht.status = 200 then 
    msgbox "Success :)" 
else 
    msgbox "Failed :(" 
0

您可以使用您的.vbs以下文件

Set winHttpRequest = CreateObject("WinHttp.WinHttpRequest.5.1") 
winHttpRequest.Open "GET", "http://localhost/mypage.aspx", false 

winHttpRequest.Send 

WScript.Echo(winHttpRequest.GetAllResponseHeaders()) 
WScript.Echo(winHttpRequest.ResponseText) 

更多的例子,請參閱http://www.neilstuff.com/winhttp/

你應該能夠調用任何URL(包括.aspx頁)您的服務器上(或互聯網)上