Cannot connect to external websites - WebClient

If you need to call external web pages. You may need the following code 

System.Net.WebProxy webProxy = new System.Net.WebProxy("172.28.3.10:8080");

System.Net.WebClient webClient = new System.Net.WebClient();

webClient.Encoding = System.Text.Encoding.UTF8;

webClient.Proxy = webProxy;

string x = webClient.DownloadString("http://www.raychou.com/weather/rss.php?id=58357");

 

posted @ 2008-11-28 15:07  IamV  阅读(355)  评论(0编辑  收藏  举报