【问题标题】:Call https page via .vbs script fails ... why?通过 .vbs 脚本调用 https 页面失败……为什么?
【发布时间】:2010-01-20 06:36:54
【问题描述】:

这是脚本。尝试自行执行... 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

【问题讨论】:

    标签: vbscript https scheduled-tasks


    【解决方案1】:

    “在 Internet Explorer 8 中,不支持 VBScript 语法”

    -- http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx

    这可能是问题吗?

    【讨论】:

    • 不,这不是问题。我上面的意思是我可以从浏览器转到 URL“myurlhere.com”……我不能做的是通过运行上面的 vbs 脚本到达那里。我在相同的凭据下运行两者。
    【解决方案2】:

    问题在于该页面需要 Windows 身份验证,即使脚本以经过身份验证的用户身份运行...由于在询问时未使用用户名和密码响应而失败。

    解决方案: * 启用匿名身份验证 * 更新 web.config 以便通知控制器不需要经过身份验证的用户

    【讨论】:

    • 关闭 Windows 身份验证并不是真正的答案。假设您的网站因某种原因而开启!
    猜你喜欢
    • 1970-01-01
    • 2013-03-07
    • 2014-01-09
    • 1970-01-01
    • 1970-01-01
    • 2013-03-13
    • 1970-01-01
    • 2010-12-11
    • 2011-12-04
    相关资源
    最近更新 更多