Beispiel #1
0
 private void FrmEx_Load(object sender, EventArgs e)
 {
     #region 获取信息の块(每次登录都会重新获取)                          //待编辑
     Mydata.Gtk        = Myhelp.getGtk(Mydata.Cookies);  //gtk
     Mydata.isChanging = false;
     Mydata.Iuin       = Myhelp.getIuin(Mydata.Cookies); //登录者QQ
     string Iname = Myhelp.getIname(Myhelp.postHtml("http://card.show.qq.com/cgi-bin/card_user_mainpage?g_tk=" + Mydata.Gtk, "uin=" + Mydata.Iuin, Mydata.Cookies));
     //Debug.WriteLine(Iname);
     tsmiUser.Text = Iname == "" ? Mydata.Iuin : Iname; //如果有ID就ID,没有就用QQ
     gBoxI.Text    = Iname == "" ? Mydata.Iuin : Iname; //如果有ID就ID,没有就用QQ
     gBoxI.Text   += ".卡箱 [点此刷新]";
     #endregion
     gboxThemes.Location = new Point(-190, 27);
     ThreadStart myThreaddelegate = new ThreadStart(Load_Card);
     Thread      tre = new Thread(myThreaddelegate)
     {
         IsBackground = true   // 设置为后台线程,在主窗口退出时线程强制退出
     };
     tre.Start();
 }//载入窗口时
Beispiel #2
0
        }//卖卡

        public static string Card_Fsid(string ThemeId)
        {
            return(Myhelp.postHtml("http://card.show.qq.com/cgi-bin/card_user_theme_list?g_tk=" + Gtk, "tid=" + ThemeId + " &uin=" + Iuin, Cookies));
        }//获取卡友
Beispiel #3
0
        }//买卡

        public static void Card_Sell()
        {
            Myhelp.postHtml("http://card.show.qq.com/cgi-bin/card_market_npc_sell?g_tk=" + Gtk, "", Cookies);
        }//卖卡
Beispiel #4
0
        }//该用户信息

        public static string  Card_Excg(string postdata)
        {
            return(Myhelp.postHtml("http://card.show.qq.com/cgi-bin/card_user_exchangecard?g_tk=" + Gtk, postdata, Cookies));
        }//换卡
Beispiel #5
0
 public static string Card_User(string UIN)
 {
     return(Myhelp.postHtml("http://card.show.qq.com/cgi-bin/card_user_mainpage?g_tk=" + Gtk, UIN, Cookies));
 }//该用户信息
Beispiel #6
0
        private void Load_Card()
        {
            this.FormBorderStyle = FormBorderStyle.None;
            this.Size            = new Size(327, 93);
            Rectangle rect = Screen.GetWorkingArea(this);     //获取显示器的分辨率

            this.Location     = new Point(rect.Width / 2 - this.Width / 2, rect.Height / 2 - this.Height / 2);
            lblState.Location = new Point(0, 0);
            #region 卡片信息处理
            string CARD_IFFO = Myhelp.getHtml("http://appimg2.qq.com/card/mk/card_info_v3.js");                                                           //有网时
            string CARD_MINI = Myhelp.postHtml("http://card.show.qq.com/cgi-bin/card_mini_get?g_tk=" + Mydata.Gtk, "uin=" + Mydata.Iuin, Mydata.Cookies); //已收集的套卡

            Regex           regStr = new Regex("id=\"(.*)\" num=\"(.*)\"", RegexOptions.IgnoreCase);                                                      //已收集套卡信息的正则
            MatchCollection mats   = regStr.Matches(CARD_MINI);


            regStr = new Regex(@"(\d{2,4}),'(.*|[\(].*[\)])',(\d),(\d{10}),.*\[(.*)\],(.),.*\d{10},(\d{1,10}),", RegexOptions.IgnoreCase); //套卡信息的正则
            MatchCollection mat = regStr.Matches(CARD_IFFO);
            for (int i = 0; i < mat.Count; i++)
            {
                int      id      = Convert.ToInt32(mat[i].Groups[1].ToString()); //--------------------
                string   name    = mat[i].Groups[2].ToString();
                int      diff    = Convert.ToInt32(mat[i].Groups[3].ToString());
                int      time    = Convert.ToInt32(mat[i].Groups[4].ToString()); //  各种的数据
                string   cards   = mat[i].Groups[5].ToString();
                int      type    = Convert.ToInt32(mat[i].Groups[6].ToString());
                int      offtime = Convert.ToInt32(mat[i].Groups[7].ToString());//----------------------
                MyMethod mmd     = delegate()
                {
                    #region 加载套卡 必须优化,代码乱的要死
                    bool xxx = false;
                    switch (type)
                    {
                    case 0:
                    case 2:
                        #region
                        xxx = false;
                        for (int x = 0; x < mats.Count; x++)
                        {
                            if (id == Convert.ToInt32(mats[x].Groups[1].ToString()))
                            {
                                xxx = true;
                                break;
                            }
                        }
                        if (xxx)
                        {
                            tvFX.Nodes[diff.ToString()].Nodes.Insert(0, name).Tag = id;       //添加子节点的同时添加它的数据(ID)
                            tvFX.Nodes[diff.ToString()].Nodes[0].BackColor        = Color.FromArgb(128, 255, 128);
                        }
                        else
                        {
                            tvFX.Nodes[diff.ToString()].Nodes.Insert(0, name).Tag = id;       //添加子节点的同时添加它的数据(ID)
                        }

                        #endregion
                        break;

                    case 1:
                    case 5:
                        #region
                        xxx = false;
                        for (int x = 0; x < mats.Count; x++)
                        {
                            if (id == Convert.ToInt32(mats[x].Groups[1].ToString()))
                            {
                                xxx = true;
                                break;
                            }
                        }
                        if (xxx)
                        {
                            tvXJ.Nodes[diff.ToString()].Nodes.Insert(0, name).Tag = id;       //添加子节点的同时添加它的数据(ID)
                            tvXJ.Nodes[diff.ToString()].Nodes[0].BackColor        = Color.FromArgb(128, 255, 128);
                        }
                        else
                        {
                            tvXJ.Nodes[diff.ToString()].Nodes.Insert(0, name).Tag = id;       //添加子节点的同时添加它的数据(ID)
                        }

                        #endregion
                        break;

                    case 9:
                        #region
                        xxx = false;
                        for (int x = 0; x < mats.Count; x++)
                        {
                            if (id == Convert.ToInt32(mats[x].Groups[1].ToString()))
                            {
                                xxx = true;
                                break;
                            }
                        }
                        if (xxx)
                        {
                            tvSK.Nodes[diff.ToString()].Nodes.Insert(0, name).Tag = id;       //添加子节点的同时添加它的数据(ID)
                            tvSK.Nodes[diff.ToString()].Nodes[0].BackColor        = Color.FromArgb(128, 255, 128);
                        }
                        else
                        {
                            tvSK.Nodes[diff.ToString()].Nodes.Insert(0, name).Tag = id;       //添加子节点的同时添加它的数据(ID)
                        }

                        #endregion
                        break;

                    default:
                        break;
                    }
                    #endregion
                };
                Invoke(mmd);
                _themeDic.Add(id, new ThemeTemplet(id, name, diff, time, cards, type, offtime)); //将信息存入该字典中
                //ds.Tables["Theme"].Rows.Add(new object[] { id, name });
            }
            regStr = new Regex(@"\[(.*),(.*),'(.*)',(\d{2,4}),", RegexOptions.IgnoreCase);//卡片信息的正则
            mat    = regStr.Matches(CARD_IFFO);
            for (int i = 0; i < mat.Count; i++)
            {
                int    id      = Convert.ToInt32(mat[i].Groups[1].ToString());
                int    themeid = Convert.ToInt32(mat[i].Groups[2].ToString());
                string name    = mat[i].Groups[3].ToString();
                int    price   = Convert.ToInt32(mat[i].Groups[4].ToString());
                _cardDic.Add(id, new CardTemplet(id, themeid, name, price));
            }


            tssState.BackColor = Color.FromArgb(128, 255, 128);
            tssState.Text      = "卡片信息加载完毕!!!";
            lblState.Visible   = false;
            #endregion
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.Size            = new Size(440, 408);
            cbTop.Left           = 366;
            this.Location        = new Point(rect.Width / 2 - this.Width / 2, rect.Height / 2 - this.Height / 2);
            lblHide.Enabled      = true;
            btnTst.Enabled       = true;
            Console.Beep();
            Debug.WriteLine(groupBox1.Location.Y);
        }//获取和载入卡片