• 微软原版系统

  • 一键重装系统

  • 纯净系统

  • 在线技术客服

魔法猪系统重装大师 一键在线制作启动 U 盘 PE 系统 用一键重装的魔法拯救失去灵魂的系统
当前位置:首页 > 教程 > 电脑教程

Q宠大乐斗协议获取好友信息代码

时间:2015年04月02日 15:42:27    来源:魔法猪系统重装大师官网    人气:12746

乐斗获取好友信息十分简单,只需要携带cookie访问 http://fight.pet.qq.com/cgi-bin/petpk?cmd=view&kind=1&sub=1就可以了

   比较难的是分析个参数的意义,需要多个好友相互对比

       服务器返回如下:

   {result:'0',msg:'',info:[{uin:'xxxxxxxx',flag:'0',yflag:'0',qqflag:'0',name:'乐斗菜菜', lilian:'19',enable:'1', factionid:'0'},{uin:'xxxxxxxx',flag:'0',yflag:'0',qqflag:'0',name:'乐斗小王子', lilian:'37',enable:'2', factionid:'10007'},{uin:'xxxxxxxx',flag:'0',yflag:'0',qqflag:'2',name:'Going_Down', lilian:'32',enable:'1', factionid:'235884'},................

   其中uin为好友的QQ号码 ,flag没去研究 yflag为会员黄钻等信息  name为网名    lilian为等级  enable为0则已经和他打斗过  1 没有打斗过  2他有拳套,没有打斗过

   factionid为帮派ID

    给出代码:

   获取好友

public Dictionary getAllFriend()
{
Dictionary entitys =new Dictionary();

HttpHelper.Encoding = Encoding.GetEncoding("gb2312");
string result = HttpHelper.GetHtml("http://fight.pet.qq.com/cgi-bin/petpk?cmd=view&kind=1&sub=1", user.Cookie);
result = result.Replace("", "");
if (result !="")
{
//历练导致少取到5个号码
Regex r =new Regex("(uin:')(?[0-9]{5,11}?)(',flag:'[0-9]{1}',yflag:'[0-9]{1}',qqflag:')(?[0-9]{1}?)(',name:')"
+"(?.+?)(',lilian:')(?[0-9]{1,2}?)(',enable:')(?[0-9]{1}?)(',factionid:')(?[0-9]{1,6}?)(')", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);

MatchCollection m = r.Matches(result);

for (int i =0; i < m.Count; i++)
{
try
{
QchongEntity entity =new QchongEntity();
entity.UserName = m[i].Groups["qq"].Value;
entity.Qqflag = Convert.ToInt32(m[i].Groups["qqflag"].Value);
entity.NickName = m[i].Groups["name"].Value;
entity.Liliang = m[i].Groups["lilian"].Value;
entity.Factionid = m[i].Groups["factionid"].Value;
entity.Enable = Convert.ToInt32(m[i].Groups["enable"].Value);
entitys.Add(entity.UserName,entity);
}
catch (Exception)
{
continue;
}
}
}

AllFriend = entitys;
return entitys;
}
宠,大乐,斗,协议,获取,好友,信息,代码,乐斗,
栏目:电脑教程 阅读:1000 2023/12/27
Win7教程 更多>>
U盘教程 更多>>
Win10教程 更多>>
魔法猪学院 更多>>

Copyright © 2015-2023 魔法猪 魔法猪系统重装大师

本站发布的系统仅为个人学习测试使用,请在下载后24小时内删除,不得用于任何商业用途,否则后果自负,请支持购买微软正版软件。

在线客服 查看微信 返回顶部