コード例 #1
0
ファイル: CalcfiForm.cs プロジェクト: sidav/ElGamalTutor
 private void calcBtn_Click(object sender, EventArgs e)
 {
     this.Enabled      = false;
     input             = BigInteger.Parse(inputBox.Text);
     input             = CryptoMath.phi(input);
     outputBox.Text    = input.ToString();
     label2.Visible    = true;
     outputBox.Visible = true;
     this.Enabled      = true;
 }
コード例 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (BigInteger.TryParse(answerBox1.Text, out ans1) && BigInteger.TryParse(answerBox2.Text, out ans2) && BigInteger.TryParse(answerBox3.Text, out ans3))
     {
         Answers.EulerAnswers[0] = (ans1 == CryptoMath.phi(fi1));
         Answers.EulerAnswers[1] = (ans2 == CryptoMath.phi(fi2));
         Answers.EulerAnswers[2] = (ans3 == CryptoMath.phi(fi3));
         //var newForm = new TutorForm3();
         //newForm.Show();
         Answers.interruptTutorial = false;
         this.Close();
     }
 }