cj,
In addition to the other comments, I normally use something like:
Dim uri As New Uri("http://www.tsbradley.n et")
Dim request As HttpWebRequest = DirectCast(WebR equest.Create(u ri),
HttpWebRequest)
Dim response As HttpWebResponse
Try
response = DirectCast(requ est.GetResponse (), HttpWebResponse )
Catch ex As WebException When TypeOf ex.Response Is HttpWebResponse
response = DirectCast(ex.R esponse, HttpWebResponse )
End Try
Then I am able to use response.Status Code to see what the HTTP status
returned was:
Debug.WriteLine (response.Statu sCode, "statusCode ")
The:
Catch ex As WebException When TypeOf ex.Response Is HttpWebResponse
Will only catch WebExceptions where the WebException.Re sponse is of type
HttpWebResponse , other exceptions will continue up to a higher exception
handler...
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"cj" <cj@nospam.nosp am> wrote in message
news:OF******** ******@TK2MSFTN GP12.phx.gbl...
| HttpWebRequest. Create(String) doesn't return any error codes but it does
| show exceptions
|
http://msdn.microsoft.com/library/de...eatetopic1.asp
| When I run
| REQUEST = Net.HttpWebRequ est.Create(URI)
| How do I test to see if it has worked? And if it didn't which of these
| exceptions occured. I'd hope I don't have to do and if for each one
| just in case.
|
| Thanks