示例#1
0
        public static string get(string ID, string Method)
        {
            int c = 0;

            if (Method == "name")
            {
                string _source = "";
                _source = MainBrowser.getSource();

                List <String> lines = Regex.Split(_source, "\n").ToList();

                foreach (string l in lines)
                {
                    string h = l.ToLower();
                    if (l.Contains(ID))
                    {
                        string name = Regex.Split(Regex.Split(h, "name=\"")[1], "\"")[0];

                        return(name);
                    }
                }
            }
            return("Not Found");
        }
示例#2
0
 private void button2_Click(object sender, EventArgs e)
 {
     MessageBox.Show("AAA" + MainBrowser.getSource() + "SSS");
 }
示例#3
0
        public void Run()
        {
            while (true)
            {
                _source      = MainBrowser.getSource();
                _sourceRight = RightBrowser.getSource();

                List <String> lines    = Regex.Split(_source, "<button ").ToList();
                List <String> linesCB  = Regex.Split(_sourceRight, "<select ").ToList();
                List <String> linesBtn = Regex.Split(_sourceRight, "<button ").ToList();
                foreach (string l in lines)
                {
                    string h = l.ToLower();
                    if (h.Contains("id=\""))
                    {
                        string btn = Regex.Split(Regex.Split(h, "id=\"")[1], "\"")[0];
                        if (h.Contains("name=\"") && btn.Contains("btn_"))
                        {
                            string name = Regex.Split(Regex.Split(h, "name=\"")[1], "\"")[0];
                            if (clicked(name))
                            {
                                MainBrowser.EvaluateScript("document.getElementById('" + btn + "').setAttribute('name', 'false')", TimeSpan.FromMilliseconds(1));
                                buttons btnT = new buttons(btn);
                                Thread  exe  = new Thread(buttons.Initalize);
                                exe.Start();
                            }
                        }

                        string chk = Regex.Split(Regex.Split(h, "id=\"")[1], "\"")[0];
                        if (h.Contains("name=\"") && chk.Contains("chk_"))
                        {
                            string name = Regex.Split(Regex.Split(h, "name=\"")[1], "\"")[0];

                            chks   chkT = new chks(chk, name);
                            Thread exe  = new Thread(chks.Initalize);
                            exe.Start();
                        }
                    }
                }
                foreach (string a in linesCB)
                {
                    string h = a.ToLower();
                    if (h.Contains("id=\""))
                    {
                        string cb = Regex.Split(Regex.Split(h, "id=\"")[1], "\"")[0];
                        if (h.Contains("value=\"") && cb.Contains("cb_"))
                        {
                            string value = Regex.Split(Regex.Split(h, "value=\"")[1], "\"")[0];

                            cbs    cbT = new cbs(cb, value);
                            Thread exe = new Thread(cbs.Initalize);
                            exe.Start();
                        }
                        string btn = Regex.Split(Regex.Split(h, "id=\"")[1], "\"")[0];
                        if (h.Contains("value=\"") && btn.Contains("btn_"))
                        {
                            string value = Regex.Split(Regex.Split(h, "value=\"")[1], "\"")[0];

                            buttons btnT = new buttons(btn);
                            Thread  exe  = new Thread(buttons.Initalize);
                            exe.Start();
                        }
                    }
                }
                foreach (string a in linesBtn)
                {
                    string h = a.ToLower();
                    if (h.Contains("id=\""))
                    {
                        string btn = Regex.Split(Regex.Split(h, "id=\"")[1], "\"")[0];
                        if (h.Contains("name=\"") && btn.Contains("btn_"))
                        {
                            string name = Regex.Split(Regex.Split(h, "name=\"")[1], "\"")[0];
                            if (clicked(name))
                            {
                                RightBrowser.EvaluateScript("document.getElementById('" + btn + "').setAttribute('name', 'false')", TimeSpan.FromMilliseconds(1));
                                buttons btnT = new buttons(btn);
                                Thread  exe  = new Thread(buttons.Initalize);
                                exe.Start();
                            }
                        }
                    }
                }
                Thread.Sleep(5);
            }
        }