var strURL = "http://999.999.999.999"; // invalid IP-address
System.Net.WebResponse objResponse = default(System.Net.WebResponse);
System.Net.WebRequest objRequest = default(System.Net.WebRequest);
objRequest = System.Net.HttpWebRequest.Create(strURL);
objRequest.Timeout = 100;
objResponse = objRequest.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(objResponse.GetResponseStream());
result = sr.ReadToEnd();
我通过firebug看到的超时是3000毫秒……不应该是这样的!