예제 #1
0
 private void client_btn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         cmd.ipep = new IPEndPoint(IPAddress.Parse(ipBox.Text), 9999);
         cmd.client.Connect(cmd.ipep);
     }
     catch
     {
         CMD_text.AppendText("Exception");
     }
 }
예제 #2
0
 private void CMDsend_Click(object sender, RoutedEventArgs e)
 {
     if (cmd.client.Connected)
     {
         command = CMDbar.Text;
         CMDbar.Clear();
         cmd.send_data = Encoding.Unicode.GetBytes(command);
         cmd.client.Send(cmd.send_data);
     }
     else
     {
         CMD_text.AppendText("client not connected");
     }
 }
예제 #3
0
 private void ipBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         try
         {
             cmd.ipep = new IPEndPoint(IPAddress.Parse(ipBox.Text), 9999);
             cmd.client.Connect(cmd.ipep);
         }
         catch
         {
             CMD_text.AppendText("Exception");
         }
     }
 }
예제 #4
0
 private void CMDbar_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Return)
     {
         if (cmd.client.Connected)
         {
             command = CMDbar.Text;
             CMDbar.Clear();
             cmd.send_data = Encoding.Unicode.GetBytes(command);
             cmd.client.Send(cmd.send_data);
         }
         else
         {
             CMD_text.AppendText("client not connected");
         }
     }
 }
예제 #5
0
 public void callback(string text)
 {
     CMD_text.Dispatcher.Invoke(new Action(() => CMD_text.AppendText(text)));
     CMD_text.Dispatcher.Invoke(new Action(() => CMD_text.ScrollToEnd()));
 }