try
{
string url = @"http://api.oodle.com/api/v2/listings?key=TEST®ion=chicago";
WebClient webClient = new WebClient();
webClient.Encoding = Encoding.UTF8;
string result = webClient.DownloadString(url);
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
该语句创建异常
string result = webClient.DownloadString(url);
和例外细节是
System.Net.WebException: Unable to connect to the remote server --->
System.Net.Sockets.SocketException: A connection attempt Failed because the connected
party did not properly respond after a period of time,or established connection Failed
because connected host has Failed to respond 192.168.0.101:808 at
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,SocketAddress
socketAddress) at Sys