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("введите текст для поля \"подсчитать\""); } }
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(); }
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(); }
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("Введите текст"); } }
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("введите текст для поля \"подсчитать\""); } }
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"); } } }