本帖最后由 hadwin_Y4Wm5 于 2016-5-4 14:54 编辑
1
2
3
4
5
6
感觉问题是出在充值前先查询后出现的一个参数上,查询后有LoginName这一项,但最终提交充值的时候,post数据中没有这一项,所以返回LoginName=null
但不知道怎么使用这个LoginName了
代码:
[C#] 纯文本查看 复制代码 for (int i = 0; i < this.listView3.Items.Count; i++)
{
if (this.listView3.Items.SubItems[5].Text == "未支付")
{
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = textBox10.Text + "/ball/cl/?module=Deposit&method=query&sid=",
Method = "post",
ContentType = "application/x-www-form-urlencoded",
Postdata = "search_name=" + this.listView3.Items.SubItems[1].Text,
CookieCollection = cookie,
ResultCookieType = ResultCookieType.CookieCollection
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
cookie.Add(result.CookieCollection);
string successKey = "flag";
Match match = Regex.Match(html, successKey);
if (match.Success)
{
string userID = HttpHelper.GetBetweenHtml(html, "\"user_id\":", ",\"user_name\"");
string hallID = HttpHelper.GetBetweenHtml(html, "\"HallID\":", ",\"CHK_ID\"");
string CHK_ID = HttpHelper.GetBetweenHtml(html, "\"CHK_ID\":\"", "\",\"date\"");
//string LoginName = HttpHelper.GetBetweenHtml(html, "\"LoginName\":\"", "\",\"HallID\"");
string userName_Post = this.listView3.Items.SubItems[1].Text;
string dateTime = ((DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ")).Replace(" ", "+")).Replace(":", "%3A");
string dateAMPM = "PM";
if (Convert.ToInt32(DateTime.Now.ToString("mm")) < 12)
{
dateAMPM = "AM";
}
else
{
dateAMPM = "PM";
}
string data ="user_id=" + userID + "&hallid=" + hallID + "&CHK_ID=" + CHK_ID + "&user_name=" + userName_Post + "&date=" + dateTime + dateAMPM + "&Currency=RMB&abamount_limit=0&amount=" + this.listView3.Items.SubItems[2].Text + "&amount_memo=&SpAmount=&SpAmount_memo=&AbCheck=1&AbAmount=0&AbAmount_memo=&ComplexAuditCheck=1&complex=0.5&NormalityAuditCheck=1&CommissionCheck=Y&DepositItem=ARD1";
item = new HttpItem()
{
URL = textBox10.Text + "/ball/cl/?module=Deposit&method=query&sid=",
Method = "post",
ContentType = "application/x-www-form-urlencoded",
Postdata = data,
Referer = textBox10.Text + "/ball/cl/index.php?module=Deposit&method=Source&langx=gb",
CookieCollection = cookie,
ResultCookieType = ResultCookieType.CookieCollection,
};
result = http.GetHtml(item);
html = result.Html;
cookie.Add(result.CookieCollection);
}
}
}
|