Get Error number in WebException Error

前端 未结 4 1803
再見小時候
再見小時候 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:05

    For Get Error Number:

    catch(System.Net.WebException e)
    {
        int errorNumber = (int)e.Status;
    }
    

提交回复
热议问题