西西軟件園多重安全檢測下載網(wǎng)站、值得信賴的軟件下載站!
軟件
軟件
文章
搜索

首頁編程開發(fā)其它知識(shí) → Q寵大樂斗協(xié)議獲取好友信息代碼

Q寵大樂斗協(xié)議獲取好友信息代碼

相關(guān)軟件相關(guān)文章發(fā)表評(píng)論 來源:本站整理時(shí)間:2010/10/24 14:17:09字體大。A-A+

作者:佚名點(diǎn)擊:477次評(píng)論:0次標(biāo)簽: Q寵大樂斗 協(xié)議

  • 類型:網(wǎng)絡(luò)認(rèn)證大。1.2M語言:中文 評(píng)分:6.6
  • 標(biāo)簽:
立即下載

樂斗獲取好友信息十分簡單,只需要攜帶cookie訪問 http://fight.pet.qq.com/cgi-bin/petpk?cmd=view&kind=1&sub=1就可以了

   比較難的是分析個(gè)參數(shù)的意義,需要多個(gè)好友相互對(duì)比

       服務(wù)器返回如下:

   {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號(hào)碼 ,flag沒去研究 yflag為會(huì)員黃鉆等信息  name為網(wǎng)名    lilian為等級(jí)  enable為0則已經(jīng)和他打斗過  1 沒有打斗過  2他有拳套,沒有打斗過

   factionid為幫派ID

    給出代碼:

   獲取好友

public Dictionary<string,QchongEntity> getAllFriend()
{
Dictionary<string,QchongEntity> entitys =new Dictionary<string,QchongEntity>();

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 !="")
{
//歷練導(dǎo)致少取到5個(gè)號(hào)碼
Regex r =new Regex("(uin:')(?<qq>[0-9]{5,11}?)(',flag:'[0-9]{1}',yflag:'[0-9]{1}',qqflag:')(?<qqflag>[0-9]{1}?)(',name:')"
+"(?<name>.+?)(',lilian:')(?<lilian>[0-9]{1,2}?)(',enable:')(?<enable>[0-9]{1}?)(',factionid:')(?<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;
}

    相關(guān)評(píng)論

    閱讀本文后您有什么感想? 已有人給出評(píng)價(jià)!

    • 8 喜歡喜歡
    • 3 頂
    • 1 難過難過
    • 5 囧
    • 3 圍觀圍觀
    • 2 無聊無聊

    熱門評(píng)論

    最新評(píng)論

    發(fā)表評(píng)論 查看所有評(píng)論(0)

    昵稱:
    表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
    字?jǐn)?shù): 0/500 (您的評(píng)論需要經(jīng)過審核才能顯示)