Hello group,
I was wondering if anyone here could help me with an odd WebClient
problem. When I run the following code:
WebClient aWebClient = new WebClient();
Byte[] aBA = aWebClient.DownloadData("http://www.microsoft.com");
string strContent = Encoding.ASCII.GetString(aBA);
Everything works as expected. However, when I run the following code:
string strURL = "http://www.microsoft.com"
WebClient aWebClient = new WebClient();
Byte[] aBA = aWebClient.DownloadData(strURL);
string strContent = Encoding.ASCII.GetString(aBA);
It fails with the error "The underlying connection was closed: unable
to connect to the remote server". Except for the code change
everything's the same. I'm aware of the KB stuff about proxy etc, but
there's no proxy here to worry about. The same behaviour is exhibited
at work and at home.
What's going on?
Cheers,
Gary