Quantcast
Channel: System.Net.WebException HTTP status code - Stack Overflow
Viewing all articles
Browse latest Browse all 7

Answer by Sergey for System.Net.WebException HTTP status code

$
0
0

You can try this code to get HTTP status code from WebException. It works in Silverlight too because SL does not have WebExceptionStatus.ProtocolError defined.

HttpStatusCode GetHttpStatusCode(WebException we){    if (we.Response is HttpWebResponse)    {        HttpWebResponse response = (HttpWebResponse)we.Response;        return response.StatusCode;    }    return null;}

Viewing all articles
Browse latest Browse all 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>