本文介绍了XMLDocument.load方法(URL)通过代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些代码,基本上读取使用XMLDocument.load方法(URI)的方法,它工作得很好,但不工作,以及如果呼叫通过代理做的XML文档。

I have a bit of code that basically reads an XML document using the XMLDocument.Load(uri) method which works fine, but doesn't work so well if the call is made through a proxy.

我不知道是否有人知道的一种方式,使这个电话(或达到同样的效果)通过代理?

I was wondering if anyone knew of a way to make this call (or achieve the same effect) through a proxy?

推荐答案

你有没有提供凭据到代理

Do you have to provide credentials to the proxy?

如果是这样,这应有助于:
提供身份验证凭据的XmlResolver从文件

If so, this should help:"Supplying Authentication Credentials to XmlResolver when Reading from a File"http://msdn.microsoft.com/en-us/library/aa720674.aspx

基本上,你...


  1. 创建使用URL

  2. 将读者的XmlResolver的凭据属性
  3. 创建一个XmlDocument实例,读者传递给Load方法

这篇关于XMLDocument.load方法(URL)通过代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 07:26