Here is the code
Function get_web_data(ByVal url)
Dim html
' Debug.WriteLine(url)
'Create a WebRequest
Dim wrRequest As WebRequest
wrRequest = WebRequest.Create(url)
'Get the Response from the Request
Dim wrResponse As WebResponse = wrRequest.GetResponse()
'Read the Response into a stream and output the stream
Dim objStream As Stream = wrResponse.GetResponseStream()
Dim objStreamReader As StreamReader = New StreamReader(objStream)
Try
html += objStreamReader.ReadToEnd()
wrRequest.Abort()
objStream.Close()
objStreamReader.Close()
Catch ex As Exception
wrRequest.Abort()
objStream.Close()
objStreamReader.Close()
get_web_data = "Error: " & ex.Message.ToString
Exit Function
End Try
get_web_data = html
Debug.WriteLine(html)
End Function
"Suhail Kaleem" <su**********@mailyoulike.com> wrote in message
news:OL**************@TK2MSFTNGP15.phx.gbl...
Hi !
I get this problem on localhost (IIS) and also on web with my
host !
Thanks
Suhail kaleem
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:On**************@TK2MSFTNGP10.phx.gbl... "Suhail Kaleem" <su**********@mailyoulike.com> schrieb: When i try to use webrequest class i get this error
The underlying connection was closed: An unexpected error occurred on a
receive.
I ma uisng vb.net and have no control on the server Can any one tell me
how i do fix that form my code?
Does this only occur with a specific server only?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>