Exemple #1
0
        private void ReceiveResponse()
        {
            var buffer   = new byte[2048];
            int received = ClientSocket.Receive(buffer, SocketFlags.None);

            if (received == 0)
            {
                return;
            }

            var data = new byte[received];

            Array.Copy(buffer, data, received);


            if (String.Equals(odabrano, "Bob"))
            {
                String text1 = Rc6.GetString(data);
                txtSourceText.Text = text1;

                byte[] outputText = Rc6.Dec(data);
                string text       = Rc6.GetString(outputText);

                string dekr     = Rc6.Dekriptuj(text);
                String zaPrikaz = "Primljeno: " + text;
                txtDestinationText.Text += zaPrikaz;
                txtDestinationText.Text += "\r\n";
            }
            else
            {
                String text1    = Rc6.GetString(data);
                String zaPrikaz = "Poslato: " + text1;
                txtDestinationText.Text += zaPrikaz;
                txtDestinationText.Text += "\r\n";
            }
            // listMessages.Items.Add("Received: " + text);
        }