示例#1
0
        private void sendMessageBtn(object sender, RoutedEventArgs e)
        {
            string sendString = m_myUseruser.username + ": " + enterMessageTxtBox.Text + "\n";

            byte[] stringBytes  = Encoding.ASCII.GetBytes(sendString);
            byte[] encryptedMsg = CAes.SimpleEncrypt(stringBytes, m_sessionKey, m_sessionKey);
            udpClient.Send(encryptedMsg, encryptedMsg.Length, ipPartnerEndPointSend);
            AllChatTxtBox.AppendText(sendString);
        }
示例#2
0
 public void addLineToChat(string line)
 {
     AllChatTxtBox.AppendText(line);
 }