A
Andy Chen
Hi all,
Please help me to look at the following code, I always get a 'The operation
has timed-out.' exception. But the URL can be opened in IE properly. I am
wondering if I missed some code. Any help would appreciate!!
HttpWebRequest httpReq;
HttpWebResponse httpResp;
try
{
httpReq =
(HttpWebRequest)WebRequest.Create("http://safety.live.com);
httpReq.Timeout = 10000;
httpReq.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; .NET CLR 1.0.3705";
httpReq.ContentType = "application/x-www-form-urlencoded";
httpResp = (HttpWebResponse) httpReq.GetResponse();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
}
Please help me to look at the following code, I always get a 'The operation
has timed-out.' exception. But the URL can be opened in IE properly. I am
wondering if I missed some code. Any help would appreciate!!
HttpWebRequest httpReq;
HttpWebResponse httpResp;
try
{
httpReq =
(HttpWebRequest)WebRequest.Create("http://safety.live.com);
httpReq.Timeout = 10000;
httpReq.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; .NET CLR 1.0.3705";
httpReq.ContentType = "application/x-www-form-urlencoded";
httpResp = (HttpWebResponse) httpReq.GetResponse();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
}