예제 #1
0
        private void loadnewini()
        {
            string str = DNFWebProxy.SendDataByGET("http://www.tx5d.com/api/v2/g.ashx", "");
            //string str = File.ReadAllText(Application.StartupPath + "\\atc.ini", System.Text.Encoding.GetEncoding("utf-8"));
            _MJson m = new _MJson(str);

            Lnode       = m.GetNode("Date").toListnode();
            label2.Text = m.GetNode("ver").toString();
            AD_webBrowser.Navigate(m.GetNode("adlink").toString());
            loadListnode(Lnode);
        }
예제 #2
0
        private void init()
        {
            string cookieStr = webBrowser_login.Document.Cookie;

            //MessageBox.Show(cookieStr);
            Por = new DNFWebProxy(cookieStr);
            //MessageBox.Show(Newtonsoft.Json.JsonConvert.SerializeObject(Por));
            if (Por != null)
            {
                comboBox_region.Items.AddRange(Por.svlist.Select(x => x.t).ToArray());
                Por.SetActList(Lnode);
                label1.Text = Por.QQ;
                if (File.Exists(Por.QQ + ".ini"))
                {
                    string[] tmpstr = File.ReadAllLines(Por.QQ + ".ini");
                    comboBox_region.SelectedIndex = int.Parse(tmpstr[0]);
                    comboBox_area.SelectedIndex   = int.Parse(tmpstr[1]);
                    comboBox_role.SelectedIndex   = int.Parse(tmpstr[2]);
                }
                pictureBox_Code.Image = Por.GetCodeBitmap();
            }
        }
예제 #3
0
        private void button_Click(object sender, EventArgs e)
        {
            AD_webBrowser.Visible = false;
            Button obj = (Button)sender;

            if (obj.Name == "button_loginout")
            {
                Por         = null;
                label1.Text = "未登录";
                HtmlDocument document = webBrowser_login.Document;
                document.ExecCommand("ClearAuthenticationCache", false, null);
                //SuppressWininetBehavior();
                webBrowser_login.Navigate("http://ui.ptlogin2.qq.com/cgi-bin/login?appid=21000115&f_url=loginerroralert&target=self&qtarget=self&s_url=http%3A//game.qq.com/comm-htdocs/login/loginSuccess.html&no_verifyimg=1&qlogin_jumpname=jump&daid=8");
                return;
            }
            if (Por == null)
            {
                MessageBox.Show("请先登录!!!");
                return;
            }
            if (!Por.ValueVerify())
            {
                MessageBox.Show("请选择角色!!!");
                return;
            }
            List <int> indexlist = new List <int>();

            for (int i = 0; i < listView1.SelectedItems.Count; i++)
            {
                indexlist.Add(listView1.SelectedItems[i].Index);
            }
            switch (obj.Name)
            {
            case "button_onekeysubmit":
            {
                if (xinyue == null || xinyue.IsDisposed)
                {
                    xinyue       = new xinyueForm(true);
                    xinyue.Owner = this;
                    xinyue.Show();
                }
                else
                {
                    xinyue.TopMost = true;
                    xinyue.TopMost = false;
                }
                Thread t = new Thread(OneSubmitAct);
                t.Start();
                //Por.OneSubmitAct(BoxAddText);
            }
            break;

            case "button_submitselect":
            {
                Por.SubmitAct(indexlist, BoxAddText);
            }
            break;

            case "button_gourl":
            {
                indexlist.ForEach(t =>
                    {
                        System.Diagnostics.Process.Start(Por.actnodeList[t].GetNode("actURL").toString());
                    });
            }
            break;

            case "button_submitCDK":
            {
                MessageBox.Show(Por.CDKexchange(textBox_CDK.Text, textBox_Code.Text));
                pictureBox_Code.Image = Por.GetCodeBitmap();
            }
            break;

            case "button_reCode":
            {
                pictureBox_Code.Image = Por.GetCodeBitmap();
            }
            break;

            case "button_xinyue":
            {
                if (xinyue == null || xinyue.IsDisposed)
                {
                    xinyue       = new xinyueForm();
                    xinyue.Owner = this;
                    xinyue.Show();
                }
                else
                {
                    xinyue.TopMost = true;
                    xinyue.TopMost = false;
                }
            }
            break;
            }
        }