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.
精彩评论