通过 .vbs 脚本调用 https 页面失败...为什么?
这是脚本。尝试自行执行...nada。尝试通过任务调度程序执行...nada。如果我通过 IE 点击下面的 URL,它就会起作用。有什么想法吗???
''//Force the script to finish on an error.
On Error Resume Next
''//Declare variables
Dim objRequest
Dim URL
Set objRequest = CreateObject("Microsoft.XMLHTTP")
''//Put together the URL link appending the Variables.
URL = "https://myurlhere.com"
''//Open the HTTP request and pass the URL to the objRequest object
objRequest.open "GET", URL , false
''//Send the HTML Request
objRequest.Send
''//Set the object to nothing
Set objRequest = Nothing
Here's the script. Tried executing by itself ... nada. Tried executing via task scheduler ... nada. If I hit the URL below via IE it works. Any ideas???
''//Force the script to finish on an error.
On Error Resume Next
''//Declare variables
Dim objRequest
Dim URL
Set objRequest = CreateObject("Microsoft.XMLHTTP")
''//Put together the URL link appending the Variables.
URL = "https://myurlhere.com"
''//Open the HTTP request and pass the URL to the objRequest object
objRequest.open "GET", URL , false
''//Send the HTML Request
objRequest.Send
''//Set the object to nothing
Set objRequest = Nothing
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“在 Internet Explorer 8 中,不支持 VBScript 语法”
-- http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx
这可能是问题所在吗?
"In Internet Explorer 8, the VBScript syntax is not supported"
-- http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx
Could this be the problem?
问题是该页面需要 Windows 身份验证,即使脚本作为经过身份验证的用户运行......它由于在询问时未响应用户名和密码而失败。
解决方案:
* 启用匿名身份验证
* 更新 web.config,以便通知控制器不需要经过身份验证的用户
The problem was that the page was requiring windows authentication and even though the script was running as an authenticated user ... it was failing due to not responding with a username and password when asked.
Solution:
* Enable anonymous authentication
* Update web.config so that notification controller didn't require an authenticated user