苏飞论坛
标题:
站长给看看想做个投票程序怎么提示验证码不对呢
[打印本页]
作者:
hxxhsy
时间:
2015-5-25 23:14
标题:
站长给看看想做个投票程序怎么提示验证码不对呢
http://www.hx58.com/vote/vote_4.html
获取
HttpHelper http = new HttpHelper();
{
URL = "http://www.hx58.com/getcode.html?tafdst=sdfr",//URL 必需项
Method = "get",//URL 可选项 默认为Get
Cookie = "",//字符串Cookie 可选项
UserAgent = "Mozilla/5.0 (Windows NT 5.1; rv:35.0) Gecko/20100101 Firefox/35.0",//用户的浏览器类型,版本,操作系统 可选项有默认值
ContentType = "text/html",//返回类型 可选项有默认值
ResultType = ResultType.Byte,
};
HttpResult result11 = http.GetHtml(item);
string html11 = result.Html;
string cookie11 = result.Cookie;
投票
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://www.hx58.com/request.aspx?action=toupiao&voteid=4&code="+textBox1.Text+"&xuanshouid=269&name=&tel=&k=Fri%20May%2022%202015%2022:44:12%20GMT+080040000",
Method = "get",//URL 可选项 默认为Get
Cookie = cookie11,//字符串Cookie 可选项
Referer = "http://www.hx58.com/vote/vote_4.html",//来源URL 可选项
UserAgent = "Mozilla/5.0 (Windows NT 5.1; rv:35.0) Gecko/20100101 Firefox/35.0",//用户的浏览器类型,版本,操作系统 可选项有默认值
ContentType = "text/html",//返回类型 可选项有默认值
ResultType = ResultType.Byte,
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
string cookie = result.Cookie;
作者:
站长苏飞
时间:
2015-5-26 08:06
第一步先从投票或者验证码页面获取Cookie,
带着Cookie去获取验证码,然后再带这个Cookie去操作
作者:
hxxhsy
时间:
2015-5-26 09:12
站长苏飞 发表于 2015-5-26 08:06
第一步先从投票或者验证码页面获取Cookie,
带着Cookie去获取验证码,然后再带这个Cookie去操作
是啊
欢迎光临 苏飞论坛 (http://www.sufeinet.com/)
Powered by Discuz! X3.4