Example #1
0
        private async void command()
        {
            if (intxt.Text == "!help")
            {
                intxt.Clear();

                textBox1.AppendText("\r\n!help - 프로그램 내 명령어를 봅니다.\r\n" +
                                    "!clr - 출력창을 지웁니다.\r\n" +
                                    "!info - 프로그램 정보를 봅니다.\r\n" +
                                    "!logging - 현재 출력된 내용을 \"" + Application.StartupPath + @"\logging" + kmm.logging + ".txt\"에 기록합니다.\r\n" +
                                    "!log - 로그 옵션을 봅니다.\r\n" +
                                    "!systeminfo - 시스템 정보를 출력시켜줍니다.(!sinfo 도 됩니다)\r\n");
                return;
            }
            else if (intxt.Text == "!clr")
            {
                intxt.Clear();

                textBox1.Clear();
            }
            else if (intxt.Text == "!info")
            {
                intxt.Clear();

                textBox1.AppendText("\r\n프로그램 버전: V4.5 PREMIUM\r\nGUI MODE Version: V2.0\r\n"); //업데이트 수정
                return;
            }
            else if (intxt.Text == "!systeminfo" | intxt.Text == "!sinfo")
            {
                intxt.Clear();
                new Thread(new ThreadStart(system_checker)).Start();
                return;
            }
            else if (intxt.Text == "!logging")
            {
                intxt.Clear();

                StreamWriter Abc;

                int VB = Convert.ToInt16(kmm.logging);
                VB++;
                Abc = File.CreateText(Application.StartupPath + @"\logging" + kmm.logging + @".txt");
                await Abc.WriteLineAsync(textBox1.Text);

                Abc.Close();
                kmm.logging = VB.ToString();
                kmm.Save();
                textBox1.AppendText("\r\n로그를 기록했습니다.\r\n");
                return;
            }
            else if (intxt.Text == "!log")
            {
                intxt.Clear();

                textBox1.AppendText("\r\n!log -reset : 로그를 초기화 시킵니다.\r\n");
                return;
            }
            else if (intxt.Text == "!srvdata")
            {
                intxt.Clear();

                textBox1.AppendText("\r\n" + shell.ToString());
                return;
            }
            else if (intxt.Text == "!log -reset")
            {
                lock (this)
                {
                    intxt.Clear();

                    int p = Convert.ToInt16(kmm.logging);
                    for (int i = 1; i != p; i++)
                    {
                        string   K    = Application.StartupPath + @"\logging" + i + @".txt";
                        FileInfo kdel = new FileInfo(K);
                        if (kdel.Exists)
                        {
                            kdel.Delete();
                        }
                    }
                    textBox1.AppendText("\r\n로그를 초기화 했습니다.");
                }
                kmm.logging = "1";
                kmm.Save();
                return;
            }
            // 서버 명령어
            else if (starting)
            {
                if (intxt.Text == "help")
                {
                    helpdata = true;
                }
                q.StandardInput.WriteLine(this.intxt.Text);
                this.intxt.Clear();

                return;
            }
            else
            {
                intxt.Clear();
                textBox1.AppendText("\r\n알 수 없는 명령어입니다, !help로 프로그램 내 명령어를 확인하실 수 있습니다\r\n");
                return;
            }
        }