コード例 #1
0
        void Send()
        {
            var message = new client_server.Message
            {
                sender = textBox_name.Text, message = textBox_input_freld.Text
            };

            client.Send(message);
        }
コード例 #2
0
        private void GetMessage(client_server.Message message, Object sender)
        {
            var mes = $"\n{message.sender} :{message.message}\n" + System.Environment.NewLine;

            if (textBox_chat.InvokeRequired)
            {
                textBox_chat.Invoke(new Action <string>((s) => textBox_chat.AppendText(s)), mes);
            }
            else
            {
                textBox_chat.AppendText(mes);
            }
        }