private void SendMSG_Button_Click(object sender, EventArgs e) { DateTime dt = DateTime.Now; RecvBox.AppendText(dt.ToString() + " " + CFG.UserID + ":" + Environment.NewLine); RecvBox.AppendText(TransBox.Text + Environment.NewLine); byte[] sendcache = AES_module.AES_Encrypt(Encoding.UTF8.GetBytes(TransBox.Text), AES_Key, AES_IV); PUB.s.Send(sendcache); TransBox.Clear(); }
private void textbox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == (Keys.Control | Keys.Enter)) { DateTime dt = DateTime.Now; RecvBox.AppendText(dt.ToString() + " " + CFG.UserID + ":" + Environment.NewLine); RecvBox.AppendText(TransBox.Text + Environment.NewLine); byte[] sendcache = AES_module.AES_Encrypt(Encoding.UTF8.GetBytes(TransBox.Text), PUB.AES_Key, PUB.AES_IV); PUB.s_chat.Send(sendcache); TransBox.Clear(); TransBox.Focus(); } }