开发者

issue with WebClient DownloadString

issue with WebClient DownloadString :

My Code ~

WebClient Wc = new WebClient();
string myUrl = "http://www.google.com";
string myStr = string.Empty;
myStr = Wc.DownloadString(myUrl);
Console.Write(myStr);

Error : The remote server returned an error: (401) Unauthorized.

Note :

Internet is w开发者_Python百科orking properly then what can be the issue with this ?


I suspect you may need to specify some proxy settings. Use Wireshark to look at the difference between what happens in your test app and what happens in a browser. I expect that both are going to a proxy, but that the browser request has proxy authentication and the WebClient one doesn't.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜