private void CommandTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.Enter)
            {
                return;
            }

            var command = CommandTextBox.Text;

            if (string.IsNullOrEmpty(command))
            {
                return;
            }

            var sendResult = false;

            try
            {
                CommandTextBox.Clear();
                sendResult = m_comConnector.Send(command);
            }
            catch (Exception ex)
            {
                s_logger.Warn(ex);
            }

            AppendTrace(sendResult ? ">" + command : "Failed to send command.");
        }
Exemple #2
0
 private void SendCommandButton_Click(object sender, RoutedEventArgs e)
 {
     TheServer.SendCommand(CommandTextBox.Text);
     ConsoleLogTextBox.AppendText($"SYSTEM COMMAND SENT : {CommandTextBox.Text}");
     ConsoleLogTextBox.AppendText(Environment.NewLine);
     ConsoleLogTextBox.ScrollToEnd();
     CommandTextBox.Clear();
 }
Exemple #3
0
 private void CommandTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key != Key.Enter)
     {
         return;
     }
     ServerProc.StandardInput.WriteLine(CommandTextBox.Text);
     CommandTextBox.Clear();
 }
 private void SendBTN_Click(object sender, EventArgs e)
 {
     if (CommandTextBox.Text.ToLower() == "cmds")         //check if the user send cmds so we can display the commands
     {
         CommandBox.AppendText(Functions.TextToBox[0]);   //Append text to the command richtextbox
         CommandTextBox.Clear();                          //clear the command textbox
     }
     else if (CommandTextBox.Text.ToLower() == "credits") //check if the user send credits so we can display the credits
     {
         CommandBox.AppendText(Functions.TextToBox[1]);   //Append text to the command richtextbox
         CommandTextBox.Clear();                          //clear the command textbox
     }
     else if (CommandTextBox.Text.ToLower() == "clear")
     {
         CommandBox.Clear();
         CommandTextBox.Clear();
     }
     else
     {
         NamedPipes.CommandPipe(CommandTextBox.Text); //command pipe function to send the text in the command textbox
         CommandTextBox.Clear();                      //clear the command textbox
     }
 }
Exemple #5
0
 private void SayBtn_Click(object sender, RoutedEventArgs e)
 {
     try { ServerProc.StandardInput.WriteLine("say " + CommandTextBox.Text); }
     catch { }
     CommandTextBox.Clear();
 }