Errors getting a web page - An unhandled exception of type 'System.Net.WebException'

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

What can cause this error from the following code?

An unhandled exception of type 'System.Net.WebException' occurred in
system.dll

Additional information: The underlying connection was closed: Unable to
connect to the remote server.


CODE:

'Create a new WebRequest object, which can only be done through
'the static Create method of the WebRequest class
Dim wrGETURL As WebRequest
wrGETURL = WebRequest.Create("http://127.0.0.1/")

'use whatever settings have been configured in Internet Explorer
wrGETURL.Proxy = WebProxy.GetDefaultProxy

'use it to obtain a Stream object corresponding to the
'response to your request.
Dim objStream As Stream
objStream = wrGETURL.GetResponse.GetResponseStream



This works on one machine and not the other. I've uninstalled VS2003 and
re-installed and no luck. It has to be a configuration on the machine
itself right?
 
This works on one machine and not the other. I've uninstalled VS2003 and
re-installed and no luck. It has to be a configuration on the machine
itself right?

And both have a webserver installed?

Cor
 
Thanks for getting me looking in the right place Cor - I couldn't even
serve a web page which got me looking hard into the network settings.

I am so happy - it was ZoneAlarm. I uninstalled and everything is fine now.

I didn't know it because I wasn't even running it - I has it NOT running on
startup so I thought it was totally off, but it must still do something
with the network stack or something. Anyway it all works now!

Thanks
 
Thanks for getting me looking in the right place Cor - I couldn't even
serve a web page which got me looking hard into the network settings.

I am so happy - it was ZoneAlarm. I uninstalled and everything is fine
now.

I didn't know it because I wasn't even running it - I has it NOT
running on startup so I thought it was totally off, but it must still
do something with the network stack or something. Anyway it all works
now!

Thanks
 
Back
Top