Пример #1
0
        private void Transmit_Click(object sender, EventArgs e)
        {
            if (Stat.Text != string.Empty)
            {
                string a = Send.Text;
                string b = Recv.Text;

                //      if (a.Length + (int)Math.Log((b.Length+1),2)  == b.Length)
                //         {
                decoder = new Decoder(aaa);
                coder.Code(Converter.ConvertToArray(Send.Text));
                decoder.Decode(Converter.ConvertToArray(Recv.Text));
                ErrorText.Text = "";


                Stat.Text  = coder.PrintInformation();
                Stat2.Text = decoder.PrintInformation();
                //       }
                //    else Stat2.Text = "потеря данных";
            }
            else
            {
                MessageBox.Show("введите текст для поля \"подсчитать\"");
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            aaa   = Convert.ToInt32(Send.Text.Length);
            coder = new Coder(aaa);
            coder.Code(Converter.ConvertToArray(Send.Text));

            Stat.Text = coder.PrintInformation();
            Recv.Text = coder.PrintInformation1();
        }
Пример #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            Coder             coder = new Coder(_point_State_color, new TimeSpan(0, 2, 0));
            CancellationToken token = _tokenSrcCancel.Token;
            Task task = new Task(() => coder.Code(token), token);

            task.ContinueWith(coding_exception_handler, TaskContinuationOptions.OnlyOnFaulted);
            task.ContinueWith(coding_done_handler, TaskContinuationOptions.OnlyOnRanToCompletion);
            task.Start();
        }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (Send.Text != string.Empty)
            {
                aaa   = Convert.ToInt32(Send.Text.Length);
                coder = new Coder(aaa);
                coder.Code(Converter.ConvertToArray(Send.Text));

                Stat.Text = coder.PrintInformation();
                Recv.Text = coder.PrintInformation1();
            }
            else
            {
                MessageBox.Show("Введите текст");
            }
        }
Пример #5
0
        private void Transmit_Click(object sender, EventArgs e)
        {
            if (Stat.Text != string.Empty)
            {
                decoder = new Decoder(aaa);
                coder.Code(Converter.ConvertToArray(Send.Text));
                decoder.Decode(Converter.ConvertToArray(Recv.Text));
                ErrorText.Text = "";


                Stat.Text  = coder.PrintInformation();
                Stat2.Text = decoder.PrintInformation();
            }
            else
            {
                MessageBox.Show("введите текст для поля \"подсчитать\"");
            }
        }
Пример #6
0
 static void Main(string[] args)
 {
     while (true)
     {
         Console.Write("ID:");
         var id          = Console.ReadLine();
         var coder       = new Coder();
         var oneTimePass = coder.Code(id, DateTime.UtcNow);
         Console.WriteLine("OTP:" + oneTimePass);
         Console.WriteLine("Password:"******"Login Succesfull");
         }
         else
         {
             Console.WriteLine("Please request another password");
         }
     }
 }