I am using the WebClient class to post some data to a web form. I would like to get the response status code of the form submission. So far I\'ve found out how
WebClient
You should use
if (e.Status == WebExceptionStatus.ProtocolError) { HttpWebResponse response = (HttpWebResponse)ex.Response; if (response.StatusCode == HttpStatusCode.NotFound) System.Diagnostics.Debug.WriteLine("Not found!"); }