C#通过wap开心网首页匹配个人信息
下面这段代码在程序中不需要了,贴到这里保存下。
Code
- 下面是wap验证账号方式
- list_User.Items[i].SubItems[7].Text = "登陆成功";
- Show_Log("[账号:]" + list_User.Items[i].SubItems[1].Text + " 登陆成功。");
- Match match = Regex.Match(htmlcode, @"(?<=uid=)\d+");
- if (match.Success)
- {
- Accountlist[i].UserID = match.ToString();
- list_User.Items[i].SubItems[3].Text = match.ToString();
- match = Regex.Match(htmlcode, @"[^""]+(?="" class=""tdno"">好友)");
- string url = "http://wap.kaixin001.com" + match.ToString();
- htmlcode = eking.WAPGet(url, "utf-8", cookie);
- match = Regex.Match(htmlcode, @"(?<=<span class=""c6"">共)\d+");
- Accountlist[i].FriendCount = match.ToString();
- list_User.Items[i].SubItems[6].Text = match.ToString();
- htmlcode = eking.WAPGet("http://wap.kaixin001.com/home/detail.php?uid=" + Accountlist[i].UserID, "utf-8", cookie);
- match = Regex.Match(htmlcode, @"(?<=</td><td>)[^<]+");
- if (match.Success)
- {
- Accountlist[i].UserName = match.ToString();
- list_User.Items[i].SubItems[4].Text = match.ToString();
- match = Regex.Match(htmlcode, @"(?<=性别:</td><td>)[^<]+");
- if (match.Success)
- {
- Accountlist[i].UserSex = match.ToString();
- list_User.Items[i].SubItems[5].Text = match.ToString();
- Show_Log("[账号:]" + list_User.Items[i].SubItems[1].Text + ",ID:" + Accountlist[i].UserID + "," + Accountlist[i].UserName + ",性别:" + Accountlist[i].UserSex + ",好友数量:" + Accountlist[i].FriendCount + "");
- }
- }
- else
- list_User.Items[i].SubItems[4].Text = "获取失败";
- }
- else
- list_User.Items[i].SubItems[3].Text = "获取失败";
Popularity: unranked [?]
最新评论