用DOM实现文章采集--采集到网页源码(6)
来源:未知 责任编辑:责任编辑 发表时间:2014-04-20 03:40 点击:次
encoding = this._HttpEncoding;
}
info.HTML = new StreamReader(responseStream, encoding).ReadToEnd();
info.ContentType = response.ContentType;
info.StatusCode = response.StatusCode;
}
catch (WebException WE)
{
if (WE.Response != null)
{
info.StatusCode = (WE.Response as HttpWebResponse).StatusCode;
}
else
{
info.StatusCode = HttpStatusCode.ServiceUnavailable;
}
info.Code = "错误:" + WE.Message;
}
catch (Exception ex)
{
info.Code = "错误:" + ex.Message;
info.StatusCode = HttpStatusCode.InternalServerError;
}
finally
{
if (responseStream != null)
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>