有时候读取的xml位于一个需要授权才能访问的http站点上
读取最简单可以使用以下方法:

通过需要授权访问的http读取xml文件request = (HttpWebRequest)WebRequest.Create(url);
通过需要授权访问的http读取xml文件request.Method 
= "GET";
通过需要授权访问的http读取xml文件request.Credentials 
= new NetworkCredential(form.username,form.password);
通过需要授权访问的http读取xml文件HttpWebResponse result 
= (HttpWebResponse) request.GetResponse();
通过需要授权访问的http读取xml文件
通过需要授权访问的http读取xml文件Stream sData 
= result.GetResponseStream();
通过需要授权访问的http读取xml文件XmlTextReader reader 
= new XmlTextReader(sData);
通过需要授权访问的http读取xml文件
通过需要授权访问的http读取xml文件

相关文章:

  • 2022-01-18
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-08-24
  • 2022-01-01
猜你喜欢
  • 2023-03-21
  • 2021-07-28
  • 2022-12-23
  • 2023-03-21
相关资源
相似解决方案