用DOM实现文章采集--采集到网页源码(3)
来源:未知 责任编辑:责任编辑 发表时间:2014-04-20 03:40 点击:次
get
{
return this._TimeOut;
}
set
{
this._TimeOut = value;
}
}
#endregion
public RemoteRes Get(string uri)
{
return Get(new Uri(uri));
}
public RemoteRes Get(Uri uri)
{
RemoteRes info = new RemoteRes();
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Timeout = this._TimeOut;
request.UserAgent = this._UserAgent;
request.Method = "GET";
request.Referer = string.Concat("http://", uri.Host);
if (this._ProxyHost.Length > 0)
{
request.Proxy = new WebProxy(this._ProxyHost, this._ProxyInt);
}
HttpWebResponse response = null;
Stream responseStream = null;
try
{
Encoding encoding;
response = (HttpWebResponse)request.GetResponse();
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>