C# HttpWebRequest.GetResponse - how is StatusCode usage handled for a non-exception vs webexception response?
问题 Can someone help clear up the usage of the "StatusCode" property in HttpWebResponse and WebException? For example it seems that if: a) there is no exception, then the HttpWebResponse will have a StatusCode that could have some values that indicate both: - success (e.g. OK, Accepted etc) - failure (e.g. UseProxy, RequestTimeout etc) b) there is a WebExeption throw, which itself has a response object that again has a StatusCode (which I assume is based on the same HttpStatusCode Enumeration.