Beispiel #1
0
        private void Send_Click(object sender, EventArgs e)
        {
            try
            {
                System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
                byte[] msg = new byte[262200];
                msg = enc.GetBytes(MessageToSend.Text);
                sck.Send(msg);

                showNewMessage(MessageToSend.Text, false);
                MessageToSend.Clear();
                MessageToSend.Focus();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Could not send message:");
                Console.WriteLine(ex.ToString());
            }
        }