Get Error number in WebException Error

前端 未结 4 1804
再見小時候
再見小時候 2021-02-19 04:40

How To Get Error number in WebException Error?

try
{
     HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(\"site\");
     HttpWebResponse response         


        
4条回答
  •  醉梦人生
    2021-02-19 05:12

    You could try to parse the message, but there isn't always an error number. A timeout for example doesn't result in an HTTP error code.

提交回复
热议问题