相当于 VBScript 中的 DefaultCredentials [英] Equivalent of DefaultCredentials in VBScript
问题描述
我有一个向 URL 发出 GET 请求的 VBScript 文件:
I have a VBScript file which makes a GET request to a URL:
Dim o
Set o = CreateObject("MSXML2.XMLHTTP")
o.open "GET", "http://www...", False
o.send
我是 VBScript 的新手.在 C# 中,我将在 Web 服务对象上使用 CredentialCache.DefaultCredentials
来传递凭据以及此请求.我如何在 VBScript 中做同样的事情?
I'm new to VBScript. In C# I would use CredentialCache.DefaultCredentials
on a web service object to pass the credentials along with this request. How can I do the same in VBScript?
谢谢!
推荐答案
据我所知,MSXML2 不支持这个.您可以尝试使用以下方法自动化 Internet Explorer:
To my knowledge, MSXML2 doesn't support this. You could try automating Internet Explorer with:
CreateObject("InternetExplorer.Application")
我知道 IE 可以通过集成身份验证传递您的凭据.然而,使用 IE 和 VBScript 往往会得到非常不一致的结果,所以如果这是一个要求并且你有选择的话,我建议坚持使用 C#.
I know that IE can pass your credentials via integrated authentication. However working with IE and VBScript tends to end with very inconsistent results, so I advise sticking with C# if this is a requirement and you have the option.
这篇关于相当于 VBScript 中的 DefaultCredentials的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!