private void textBox3_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { if (textBox1.Text != "" && textBox3.Text != "") { Datagram msg = new Datagram(0); msg.AppendString(textBox1.Text); msg.AppendString(textBox3.Text); sendDatagram(msg); textBox3.Text = ""; } } }
private void textBox1_TextChanged(object sender, EventArgs e) { Datagram data = new Datagram(1); data.AppendString(textBox1.Text); sendDatagram(data); }
void requestnextpart() { Datagram nextpart = new Datagram(3); nextpart.AppendString(rcvfile); nextpart.AppendInteger(rcvnextpart); Invoke(MessageUnicastSender, nextpart, rcvsender); }
private void timer1_Tick(object sender, EventArgs e) { Datagram data = new Datagram(1); data.AppendString(textBox1.Text); Invoke(MessageSender, data); foreach (KeyValuePair <string, long> file in pubfiles) { Datagram filedatagram = new Datagram(2); filedatagram.AppendString(file.Key); filedatagram.AppendLong(file.Value); Invoke(MessageSender, filedatagram); } }