如何从同一台服务器上的VBS文件调用ASP.NET文件(.aspx)?
我需要VBS文件将执行带有一些参数的asp.net文件。
谢谢
发布于 2009-09-24 09:04:24
像这样的东西?
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"或
请记住,您可以直接从任务计划程序并使用运行网页
发布于 2009-09-24 16:45:19
您可以在.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/
你应该能够在你的服务器上(或在互联网上)调用任何网址(包括.aspx页面)
发布于 2009-09-24 23:56:09
可以使用ServerXMLHttp:-
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 :("https://stackoverflow.com/questions/1470510
复制相似问题