首页 > 心情日志, 资料收集 > C#通过wap开心网首页匹配个人信息

C#通过wap开心网首页匹配个人信息

2009年12月30日 张筱祥 发表评论 阅读评论

下面这段代码在程序中不需要了,贴到这里保存下。

Code
  1.  下面是wap验证账号方式
  2. list_User.Items[i].SubItems[7].Text = "登陆成功";
  3. Show_Log("[账号:]" + list_User.Items[i].SubItems[1].Text + " 登陆成功。");
  4. Match match = Regex.Match(htmlcode, @"(?<=uid=)\d+");
  5. if (match.Success)
  6. {
  7.     Accountlist[i].UserID = match.ToString();
  8.  
  9.     list_User.Items[i].SubItems[3].Text = match.ToString();
  10.  
  11.     match = Regex.Match(htmlcode, @"[^""]+(?="" class=""tdno"">好友)");
  12.  
  13.  
  14.     string url = "http://wap.kaixin001.com" + match.ToString();
  15.     htmlcode = eking.WAPGet(url, "utf-8", cookie);
  16.  
  17.     match = Regex.Match(htmlcode, @"(?<=<span class=""c6"">共)\d+");
  18.  
  19.     Accountlist[i].FriendCount = match.ToString();
  20.     list_User.Items[i].SubItems[6].Text = match.ToString();
  21.  
  22.  
  23.     htmlcode = eking.WAPGet("http://wap.kaixin001.com/home/detail.php?uid=" + Accountlist[i].UserID, "utf-8", cookie);
  24.  
  25.  
  26.     match = Regex.Match(htmlcode, @"(?<=</td><td>)[^<]+");
  27.     if (match.Success)
  28.     {
  29.         Accountlist[i].UserName = match.ToString();
  30.         list_User.Items[i].SubItems[4].Text = match.ToString();
  31.  
  32.         match = Regex.Match(htmlcode, @"(?<=性别:</td><td>)[^<]+");
  33.  
  34.         if (match.Success)
  35.         {
  36.             Accountlist[i].UserSex = match.ToString();
  37.             list_User.Items[i].SubItems[5].Text = match.ToString();
  38.             Show_Log("[账号:]" + list_User.Items[i].SubItems[1].Text + ",ID:" + Accountlist[i].UserID + "," + Accountlist[i].UserName + ",性别:" + Accountlist[i].UserSex + ",好友数量:" + Accountlist[i].FriendCount + "");
  39.  
  40.         }
  41.     }
  42.     else
  43.         list_User.Items[i].SubItems[4].Text = "获取失败";
  44. }
  45. else
  46.     list_User.Items[i].SubItems[3].Text = "获取失败";

Popularity: unranked [?]

你可能对下面的内容也感兴趣

分类: 心情日志, 资料收集 标签: , 阅读:537
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.
3533640189102548164549194438112530421431221526473934416274713501733434624203723292832112821