RicercatoreSbadato,
I believe an exception is thrown in this case. When this happens, check
the Response property of the exception. This is a HttpWebResponse (in the
case of HTTP transfers). You can then check the StatusCode property and
look for the 404 response.
You might be better off using HttpWebRequest and HttpWebResponse
directly in this case, since you can check the response code without having
to catch an exception.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"RicercatoreSbadato" <em***********@yahoo.it> wrote in message
news:11********************@g14g2000cwa.googlegrou ps.com...
I am using the "WebClient" to post some data to a server. It could
happen that the server answers "404 Not found". But how can I take and
know the error code of the HTTP?
It seems that "WebClient" doesn't expose any methods to understand this
code..