博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

获取Http响应状态码

Posted on 2010-01-21 10:26  Mr.Night  阅读(855)  评论(0)    收藏  举报

 

1 catch(WebException ex)   
2 {     
3    HttpWebResponse response = (HttpWebResponse)ex.Response;   
4    int statusCode = (int)response.StatusCode;
5