473,396 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

'System.Net.WebException' - Strange Error

Very strange - this code is copy and paste from the net and works on 2 of
my 3 development machines - but of course not the machine I need to run it
on.

I've seen similar posts, but no solutions that work for me. Is it a problem
with my proxy settings on this 1 machine? I have all the boxes unchecked
for LAN Settings. Net browsing is fine. Other machines are the same.

The error is:
An unhandled exception of type 'System.Net.WebException' occurred in
system.dll

Additional information: The underlying connection was closed: The remote
name could not be resolved.
Code for form load:

'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:www.cnn.com")

'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()

'After you have the response stream, you can treat it like any
other stream (such as from opening a text file) and read through its
contents line by line or even all at once. The loop below reads the stream
one line at a time until the ReadLine method returns Nothing, outputting
each line to the console.
Dim objReader As New StreamReader(objStream)
Dim i As Integer = 0

Me.TextBox1.Text = objReader.ReadToEnd
Nov 20 '05 #1
3 3956
wrGETURL = WebRequest.Create("http:www.cnn.com")

is that a typo?

Greg
"A User" <no****@nowhere.com> wrote in message
news:Xn******************************@216.168.3.30 ...
Very strange - this code is copy and paste from the net and works on 2 of
my 3 development machines - but of course not the machine I need to run it
on.

I've seen similar posts, but no solutions that work for me. Is it a
problem
with my proxy settings on this 1 machine? I have all the boxes unchecked
for LAN Settings. Net browsing is fine. Other machines are the same.

The error is:
An unhandled exception of type 'System.Net.WebException' occurred in
system.dll

Additional information: The underlying connection was closed: The remote
name could not be resolved.
Code for form load:

'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:www.cnn.com")

'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()

'After you have the response stream, you can treat it like any
other stream (such as from opening a text file) and read through its
contents line by line or even all at once. The loop below reads the stream
one line at a time until the ReadLine method returns Nothing, outputting
each line to the console.
Dim objReader As New StreamReader(objStream)
Dim i As Integer = 0

Me.TextBox1.Text = objReader.ReadToEnd

Nov 20 '05 #2
Indeed that is a typo - and the url does not matter as I've tried a
whole bunch. The problem is exactly as outlined though. Can anyone help?

"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in
news:eN**************@TK2MSFTNGP12.phx.gbl:
wrGETURL = WebRequest.Create("http:www.cnn.com")

is that a typo?

Greg
"A User" <no****@nowhere.com> wrote in message
news:Xn******************************@216.168.3.30 ...
Very strange - this code is copy and paste from the net and works on
2 of my 3 development machines - but of course not the machine I need
to run it on.

I've seen similar posts, but no solutions that work for me. Is it a
problem
with my proxy settings on this 1 machine? I have all the boxes
unchecked for LAN Settings. Net browsing is fine. Other machines are
the same.

The error is:
An unhandled exception of type 'System.Net.WebException' occurred in
system.dll

Additional information: The underlying connection was closed: The
remote name could not be resolved.
Code for form load:

'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:www.cnn.com")

'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()

'After you have the response stream, you can treat it like any
other stream (such as from opening a text file) and read through its
contents line by line or even all at once. The loop below reads the
stream one line at a time until the ReadLine method returns Nothing,
outputting each line to the console.
Dim objReader As New StreamReader(objStream)
Dim i As Integer = 0

Me.TextBox1.Text = objReader.ReadToEnd



Nov 20 '05 #3
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

A User <no****@nowhere.com> wrote in
news:Xn*****************************@216.168.3.30:
Indeed that is a typo - and the url does not matter as I've tried a
whole bunch. The problem is exactly as outlined though. Can anyone help?
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in
news:eN**************@TK2MSFTNGP12.phx.gbl:
wrGETURL = WebRequest.Create("http:www.cnn.com")

is that a typo?

Greg
"A User" <no****@nowhere.com> wrote in message
news:Xn******************************@216.168.3.30 ...
Very strange - this code is copy and paste from the net and works on
2 of my 3 development machines - but of course not the machine I need to run it on.

I've seen similar posts, but no solutions that work for me. Is it a
problem
with my proxy settings on this 1 machine? I have all the boxes
unchecked for LAN Settings. Net browsing is fine. Other machines are
the same.

The error is:
An unhandled exception of type 'System.Net.WebException' occurred in
system.dll

Additional information: The underlying connection was closed: The
remote name could not be resolved.
Code for form load:

'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:www.cnn.com")

'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()

'After you have the response stream, you can treat it like any other stream (such as from opening a text file) and read through its
contents line by line or even all at once. The loop below reads the
stream one line at a time until the ReadLine method returns Nothing,
outputting each line to the console.
Dim objReader As New StreamReader(objStream)
Dim i As Integer = 0

Me.TextBox1.Text = objReader.ReadToEnd




Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sean Erwin | last post by:
I am having a very frustrating intermittent problem. I am making an A2A call to a remote server and when I issue the: WebRequest.getResponse call it occasionally fails with the following error: ...
0
by: Joe Bloggs | last post by:
I have a C# MRS application that uses the ReportingService's Render method to retrieve a byte array containing a report. The following error message occurs An unhandled exception of type...
2
by: genc_ ymeri at hotmail dot com | last post by:
Hi, I'm trying to recieve the response status code rather than the message in the below code : try { responseArray = myWebClient.UploadValues(uriString,"POST",myNameValueCollection); }...
0
by: yariv | last post by:
Hello All, I am having a very strange problem. while trying to access http page on the web. I happen to have some problems at specific machines. the exception I get is: *************...
1
by: etantonio | last post by:
Good morning, I've a problem, in the past I translate my site from google or altavista with a code similar to this : <%@ Page Language="c#" Trace="true" Debug="true" %> <%@ import...
0
by: Faiyaz | last post by:
Hello to EveryBody i'm Getting this Peculiar error System.ApplicationException: The remote server returned an error (400) Bad Request. - - > System.Net.WebException: The remote server...
2
by: tlan | last post by:
Hi, I got this error when I move my web service to Windows2003 server. I spent hours scouting on the internet and could find any answer. Please help!!! I the webservice is timeout between 1...
8
by: Tim Reynolds | last post by:
Our .Net application calls a web method of aplpication 2 that resides on their Apache server. When I as a developer C#, Studios 2003, make the call to their web method from my desktop, I receive no...
3
sid0404
by: sid0404 | last post by:
Hi I am new to the programming in c#, I have an application where I need to get data from a website now I am getting an error message if I give the input as two strings, say Sun Microsystems while...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.