Ejemplo n.º 1
0
 private void partyrank(int iid)
 {
     CookieCollection cookies = new CookieCollection();
     Cookie cookie2 = new Cookie("S", this.szCookie) {
         Domain = this.szhost
     };
     Cookie cookie = cookie2;
     cookies.Add(cookie);
     string url = "http://" + this.szhostport + "/connect/app/party/party_only_member_list?cyt=1";
     Dictionary<string, string> dictionary = new Dictionary<string, string>();
     dictionary.Add("", "");
     IDictionary<string, string> parameters = dictionary;
     parameters.Clear();
     parameters.Add("pid", this.Encrypt(iid.ToString(), this.key12));
     XmlDocument document = null;
     Label_008D:;
     try
     {
         document = this.CreatePostHttpResponse(url, parameters, 0xc350, string.Empty, Encoding.Default, cookies);
     }
     catch (Exception)
     {
         goto Label_008D;
     }
     if (document != null)
     {
         this.ranklist.Clear();
         XmlNodeList list = document.SelectSingleNode("response").SelectSingleNode("body").SelectSingleNode("party_member_list").SelectNodes("member");
         int num = 0;
         foreach (XmlNode node in list)
         {
             playerrank item = new playerrank();
             int iUser = int.Parse(node.SelectSingleNode("id").InnerText);
             item.name = node.SelectSingleNode("name").InnerText;
             num += item.point = int.Parse(node.SelectSingleNode("guild_hunting_point").InnerText);
             item.ilv = int.Parse(node.SelectSingleNode("town_level").InnerText);
             item.logintime = node.SelectSingleNode("last_login").InnerText;
             item.irank = this.geturerrank(iUser);
             this.ranklist.Add(item);
         }
         this.ranklist.Sort();
         foreach (playerrank playerrank2 in this.ranklist)
         {
             this.actionlog.Text = this.actionlog.Text + playerrank2.ToString() + "\r\n";
         }
     }
 }
Ejemplo n.º 2
0
 private void partyrank()
 {
     this.button4.Enabled = false;
     CookieCollection cookies = new CookieCollection();
     Cookie cookie2 = new Cookie("S", this.szCookie) {
         Domain = this.szhost
     };
     Cookie cookie = cookie2;
     cookies.Add(cookie);
     string url = "http://" + this.szhostport + "/connect/app/party/party_only_member_list?cyt=1";
     Dictionary<string, string> dictionary = new Dictionary<string, string>();
     dictionary.Add("", "");
     IDictionary<string, string> parameters = dictionary;
     parameters.Clear();
     parameters.Add("pid", this.Encrypt(this.iPartyid.ToString(), this.key12));
     XmlDocument document = null;
     Label_009E:;
     try
     {
         document = this.CreatePostHttpResponse(url, parameters, 0xc350, string.Empty, Encoding.Default, cookies);
     }
     catch (Exception)
     {
         goto Label_009E;
     }
     if (document != null)
     {
         FileStream stream = new FileStream("团排名输出.txt", FileMode.OpenOrCreate);
         this.ranklist.Clear();
         XmlNodeList list = document.SelectSingleNode("response").SelectSingleNode("body").SelectSingleNode("party_member_list").SelectNodes("member");
         int num = 0;
         foreach (XmlNode node in list)
         {
             playerrank item = new playerrank();
             int iUser = int.Parse(node.SelectSingleNode("id").InnerText);
             item.name = node.SelectSingleNode("name").InnerText;
             num += item.point = int.Parse(node.SelectSingleNode("guild_hunting_point").InnerText);
             item.ilv = int.Parse(node.SelectSingleNode("town_level").InnerText);
             item.logintime = node.SelectSingleNode("last_login").InnerText;
             item.irank = this.geturerrank(iUser);
             this.ranklist.Add(item);
         }
         this.getRankINFO();
         string str2 = "团贡 :" + num.ToString() + "/" + this.labelzzg + ",日贡:" + this.labelzrg + ",团排:" + this.labelzrk + "\r\n";
         this.ranklist.Sort();
         foreach (playerrank playerrank2 in this.ranklist)
         {
             byte[] bytes = Encoding.UTF8.GetBytes(playerrank2.ToString());
             stream.Write(bytes, 0, bytes.Length);
             stream.Flush();
             this.actionlog.Text = this.actionlog.Text + playerrank2.ToString() + "\r\n";
         }
         this.actionlog.Text = this.actionlog.Text + str2;
         stream.Close();
         this.getXSparty();
     }
     this.button4.Enabled = true;
 }