Get Error number in WebException Error

前端 未结 4 1805
再見小時候
再見小時候 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 can't do that because WebException(s) don't have error numbers. You can define your own error numbers if that's what you want/need to do.

    Here's the documentation You can get Status, Message, StackTrace, etc, etc.

提交回复
热议问题