Exemplo n.º 1
0
 //If scissors button is selected. Sends data to the server
 private void ScissorsButton_Click(object sender, EventArgs e)
 {
     client.WriteLineAndGetReply("\r\n" + NameTextBox.Text + " has chosen: Scissors", TimeSpan.FromSeconds(1));
     RockButton.Enabled     = false;
     ScissorsButton.Enabled = false;
     PaperButton.Enabled    = false;
 }
Exemplo n.º 2
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            string myMessage;

            myMessage       = tcpClient.WriteLineAndGetReply(txtMessage.Text, TimeSpan.FromSeconds(3)).MessageString;
            myMessage       = myMessage.Substring(0, myMessage.Length - 1);
            txtStatus.Text += myMessage + Environment.NewLine;
        }
Exemplo n.º 3
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     if (txtMessage.Text != "")
     {
         lbStatus.Items.Add("You said: " + txtMessage.Text);
         client.WriteLineAndGetReply(txtMessage.Text, TimeSpan.FromSeconds(2));
     }
     txtMessage.Clear();
 }
Exemplo n.º 4
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     try
     {
         client.WriteLineAndGetReply(txtMessage.Text, TimeSpan.FromSeconds(1));
     } catch (Exception ex)
     {
         txtStatus.Text += ex.Message + Environment.NewLine;
     }
     txtMessage.Text = "";
 }
Exemplo n.º 5
0
 private void b_Send_Click(object sender, EventArgs e)
 {
     try
     {
         CodingLetters.Clear();
         Coder(dataGridView1, tb_Message.Text.ToArray());
     }
     catch { }
     try { CoderMessage(tb_Message.Text, richTextBox1); }
     catch { }
     try { DecoderMessage(richTextBox1.Text, richTextBox2); }
     catch { }
     try { client.WriteLineAndGetReply(tb_Message.Text, TimeSpan.FromSeconds(1)); }
     catch { };
 }
Exemplo n.º 6
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     client.WriteLineAndGetReply(txtMessage.Text, TimeSpan.FromSeconds(3));
 }
Exemplo n.º 7
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     ///Write recieved reply from server to console.(WriteLine)
     ///As long as the console is open, every message you type will be sent to the server.(WriteLineAndGetReply)
     client.WriteLineAndGetReply(txtMessage.Text, TimeSpan.FromSeconds(3));
 }
Exemplo n.º 8
0
 private void Button1_Click(object sender, EventArgs e)
 {
     client.WriteLineAndGetReply("Login:"******"╥" + textBox2.Text, TimeSpan.FromMilliseconds(100));
 }
Exemplo n.º 9
0
 private void btnsend_Click(object sender, EventArgs e)
 {
     client.WriteLineAndGetReply(txtMessage.Text, TimeSpan.FromMinutes(5));
 }
Exemplo n.º 10
0
 private void button2_Click(object sender, EventArgs e)
 {
     client.WriteLineAndGetReply(txtStatu.Text, TimeSpan.FromSeconds(3));
 }
Exemplo n.º 11
0
        public void PanelDrawing_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                current = e.Location;
                // Console.WriteLine("currentClient " + current);
                String point = current.X.ToString();
                point  = point + " ";
                point  = point + current.Y.ToString();
                point  = point + " ";
                point += p.Color.ToString();
                point += " ";
                point  = point + p.Width;
                point += " ";
                point += PanelDrawingClicked;
                point += " ";

                g.DrawLine(p, old, current);
                point += old.X.ToString();
                point += " ";
                point += old.Y.ToString();
                point += " ";
                msg    = point; //  <<------------------------- Message envoyer au serveur
                //Console.WriteLine("cuuurrent" + current);
                old = current;


                // les coordonnées
                ListXcurrent = new List <string>();
                ListYcurrent = new List <string>();
                ListXold     = new List <string>();
                ListYold     = new List <string>();
                String LesXcurrent = current.X.ToString();
                String LesYcurrent = current.Y.ToString();
                String LesXold     = old.X.ToString();
                String LesYold     = old.X.ToString();
                ListXcurrent.Add((LesXcurrent));
                ListYcurrent.Add((LesYcurrent));
                ListXold.Add((LesXold));
                ListYold.Add((LesYold));

                /*
                 * ListXcurrent.ForEach(Print);
                 * void Print(string s)
                 * {
                 *   // Console.WriteLine(s);
                 * }
                 */
                txtMessageClient.Text = msg;

                try
                {
                    client.WriteLineAndGetReply(msg, TimeSpan.FromSeconds(0));
                    //client.WriteLine(msg);
                }

                catch (Exception ex)
                {
                    //Console.WriteLine("Listen thread exception! " + ex.Message);
                }



                Client Objet = new Client();
                //  Objet.Coordinates(); // Affiche
            }
        }
Exemplo n.º 12
0
 private void sendMessageButton_Click(object sender, EventArgs e)
 {
     _CLIENT.WriteLineAndGetReply(messageBox.Text, TimeSpan.FromSeconds(1));
     messageBox.Text = "";
 }
Exemplo n.º 13
0
 private void cl_sendBT_Click_1(object sender, EventArgs e)
 {
     client.WriteLineAndGetReply(cl_DataTB.Text, TimeSpan.FromSeconds(1));
 }