0
我试图访问网络的XML解析使用下面的代码:代理在.NET
System.Uri proxy = new System.Uri("http://usr:[email protected]:8080");
System.Net.WebRequest.DefaultWebProxy = new System.Net.WebProxy(proxy);
string url = "http://url/";
XmlTextReader reader = new XmlTextReader(url);
richTextBox1.Text = Convert.ToString(reader.Read());
但它给人的是代理验证需要一个错误。我已经设置了代理参数。那么有人可能会建议使其发挥作用所需的更改吗?
我不太了解C#,但是System.Uri真的很聪明,它可以自动分析和理解第一个字符串中的用户和密码吗? – 2009-06-30 08:41:59
我用python这种方式给它。我是C#的新手。我教会它会工作... – Vicky 2009-06-30 08:47:02