G
Guest
Hi,
I tried to send a HttpWebRequest, but it doesn't work, although it's so
simple.
Here is the Code:
HttpWebRequest InetReq =
(HttpWebRequest)WebRequest.Create("http://www.contoso.com/");
HttpWebResponse myResponse;
try
{
myResponse = (HttpWebResponse)InetReq.GetResponse();
}
catch (Exception ex)
{
...
}
In the catch routine I get a MessageBox showing exception "Unable to connect
to the remote server" and inner exception "Connection could not be
established because the host refused the connection".
What's wrong here?
Thanks!
I tried to send a HttpWebRequest, but it doesn't work, although it's so
simple.
Here is the Code:
HttpWebRequest InetReq =
(HttpWebRequest)WebRequest.Create("http://www.contoso.com/");
HttpWebResponse myResponse;
try
{
myResponse = (HttpWebResponse)InetReq.GetResponse();
}
catch (Exception ex)
{
...
}
In the catch routine I get a MessageBox showing exception "Unable to connect
to the remote server" and inner exception "Connection could not be
established because the host refused the connection".
What's wrong here?
Thanks!