From 21ca4e2ddfe9c53d56bfdac767844723dc1261d2 Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Wed, 23 Aug 2023 13:45:44 +0800 Subject: [PATCH] update --- OTP/Form1.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OTP/Form1.cs b/OTP/Form1.cs index d8864e3..032eb29 100644 --- a/OTP/Form1.cs +++ b/OTP/Form1.cs @@ -156,8 +156,13 @@ namespace OTP button1.Enabled = true; runonce++; } + //timer.Stop(); secretKey = Base32Encoding.ToBytes(selectedTitleInfo.SecretKey); totp = new Totp(secretKey); + if (timer.Enabled) + { + GenerateAndDisplayTotp(); + } //string totpCode = totp.ComputeTotp(); //label1.Text = totpCode; } @@ -207,6 +212,8 @@ namespace OTP label1.Text = "TOTP Code"; button1.Enabled = false; button2.Enabled = false; + circularProgressBar1.Text = "time"; + circularProgressBar1.Value = 30; } else {