用以下代码判断了2.5万个域名,发现有一小部分结果有误。

  // lots of other interesting code up here...
  catch (WebException wex)
  {
      // typical http error
      if (wex.Status == WebExceptionStatus.ProtocolError)
      {
          HttpWebResponse wrsp = (HttpWebResponse)wex.Response;
          throw new HttpException((int)wrsp.StatusCode, wrsp.StatusDescription);
      }
      else
      {
          throw new HttpException(500, wex.Message);
      }
  }
  // other interesting code goes down here...

 

GOOGLE到一个组件,测试很准,好像是收费的。 http://www.example-code.com/csharp/http_getStatus.asp

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2021-07-24
  • 2021-10-01
  • 2021-06-12
  • 2022-01-27
  • 2022-12-23
猜你喜欢
  • 2021-10-03
  • 2021-04-20
  • 2021-06-07
  • 2021-11-02
  • 2022-02-13
相关资源
相似解决方案