[C#] 纯文本查看 复制代码 int success = 0;
for (int i = 0; i < 1000; i++)
{
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "https://s.click.taobao.com/k5tpvnx",//URL 必需项
Method = "GET",//URL 可选项 默认为Get
Timeout = 100000,//连接超时时间 可选项默认为100000
ReadWriteTimeout = 30000,//写入Post数据超时时间 可选项默认为30000
IsToLower = false,//得到的HTML代码是否转成小写 可选项默认转小写
Cookie = "",//字符串Cookie 可选项
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0",//用户的浏览器类型,版本,操作系统 可选项有默认值
Accept = "text/html, application/xhtml+xml, */*",// 可选项有默认值
ContentType = "text/html",//返回类型 可选项有默认值
};
HttpResult result = http.GetHtml(item);
string strLocation = result.RedirectUrl;
if (strLocation.Length>10)
{
success++;
}
}
Response.Write(success.ToString());
Response.End();
|