Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 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();
     }
 }