diff --git a/OTP/App.config b/OTP/App.config index aee9adf..90c1718 100644 --- a/OTP/App.config +++ b/OTP/App.config @@ -1,6 +1,22 @@ - + - - - + + +
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OTP/Form1.Designer.cs b/OTP/Form1.Designer.cs index ca91e32..3e6907b 100644 --- a/OTP/Form1.Designer.cs +++ b/OTP/Form1.Designer.cs @@ -36,6 +36,8 @@ this.circularProgressBar1 = new CircularProgressBar.CircularProgressBar(); this.button3 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); + this.button5 = new System.Windows.Forms.Button(); + this.button6 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // listBox1 @@ -43,7 +45,7 @@ this.listBox1.FormattingEnabled = true; this.listBox1.Location = new System.Drawing.Point(42, 38); this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(473, 316); + this.listBox1.Size = new System.Drawing.Size(473, 368); this.listBox1.TabIndex = 0; // // label1 @@ -60,9 +62,9 @@ // // button1 // - this.button1.Location = new System.Drawing.Point(556, 302); + this.button1.Location = new System.Drawing.Point(556, 294); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(85, 51); + this.button1.Size = new System.Drawing.Size(85, 23); this.button1.TabIndex = 3; this.button1.Text = "Generate"; this.button1.UseVisualStyleBackColor = true; @@ -70,12 +72,14 @@ // // button2 // - this.button2.Location = new System.Drawing.Point(647, 302); + this.button2.Enabled = false; + this.button2.Location = new System.Drawing.Point(647, 294); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(85, 51); + this.button2.Size = new System.Drawing.Size(85, 81); this.button2.TabIndex = 3; this.button2.Text = "Copy"; this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); // // label2 // @@ -124,27 +128,47 @@ // // button3 // - this.button3.Location = new System.Drawing.Point(556, 359); + this.button3.Location = new System.Drawing.Point(556, 323); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(85, 23); this.button3.TabIndex = 7; - this.button3.Text = "Settings"; + this.button3.Text = "Manage"; this.button3.UseVisualStyleBackColor = true; // // button4 // - this.button4.Location = new System.Drawing.Point(647, 359); + this.button4.Location = new System.Drawing.Point(556, 352); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(85, 23); this.button4.TabIndex = 8; - this.button4.Text = "About"; + this.button4.Text = "Refresh"; this.button4.UseVisualStyleBackColor = true; // + // button5 + // + this.button5.Location = new System.Drawing.Point(556, 382); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(85, 23); + this.button5.TabIndex = 9; + this.button5.Text = "About"; + this.button5.UseVisualStyleBackColor = true; + // + // button6 + // + this.button6.Location = new System.Drawing.Point(647, 381); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(85, 23); + this.button6.TabIndex = 10; + this.button6.Text = "QR Code"; + this.button6.UseVisualStyleBackColor = true; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(775, 400); + this.ClientSize = new System.Drawing.Size(775, 440); + this.Controls.Add(this.button6); + this.Controls.Add(this.button5); this.Controls.Add(this.button4); this.Controls.Add(this.button3); this.Controls.Add(this.label2); @@ -170,6 +194,8 @@ private CircularProgressBar.CircularProgressBar circularProgressBar1; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button button6; } } diff --git a/OTP/Form1.cs b/OTP/Form1.cs index f00d669..5120a24 100644 --- a/OTP/Form1.cs +++ b/OTP/Form1.cs @@ -53,7 +53,8 @@ namespace OTP private void button1_Click(object sender, EventArgs e) { - button1.Enabled = false; // 禁用按钮 + button1.Enabled = false; // 禁用生成按钮 + button2.Enabled = true; // 启用复制按钮 GenerateAndDisplayTotp(); // 生成并显示 TOTP 密码 // 开始计时器 @@ -65,5 +66,9 @@ namespace OTP button1.Enabled = true; // 在窗体加载时启用按钮 } + private void button2_Click(object sender, EventArgs e) + { + Clipboard.SetText(label1.Text); + } } } diff --git a/OTP/Form2.Designer.cs b/OTP/Form2.Designer.cs new file mode 100644 index 0000000..d2ffca9 --- /dev/null +++ b/OTP/Form2.Designer.cs @@ -0,0 +1,46 @@ +namespace OTP +{ + partial class Form2 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // Form2 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(619, 367); + this.Name = "Form2"; + this.Text = "Data Manage"; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/OTP/Form2.cs b/OTP/Form2.cs new file mode 100644 index 0000000..7c04a2f --- /dev/null +++ b/OTP/Form2.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace OTP +{ + public partial class Form2 : Form + { + public Form2() + { + InitializeComponent(); + } + } +} diff --git a/OTP/Form2.resx b/OTP/Form2.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/OTP/Form2.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/OTP/OTP.csproj b/OTP/OTP.csproj index b25c7b5..1f50d66 100644 --- a/OTP/OTP.csproj +++ b/OTP/OTP.csproj @@ -1,5 +1,6 @@  + Debug @@ -12,6 +13,8 @@ 512 true true + + AnyCPU @@ -36,11 +39,27 @@ ..\packages\CircularProgressBar.2.8.0.16\lib\net40\CircularProgressBar.dll + + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll + ..\packages\Otp.NET.1.3.0\lib\net45\Otp.NET.dll + + + ..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\lib\net46\System.Data.SQLite.dll + + + ..\packages\System.Data.SQLite.EF6.1.0.118.0\lib\net46\System.Data.SQLite.EF6.dll + + + ..\packages\System.Data.SQLite.Linq.1.0.118.0\lib\net46\System.Data.SQLite.Linq.dll + ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll True @@ -66,11 +85,20 @@ Form1.cs + + Form + + + Form2.cs + Form1.cs + + Form2.cs + ResXFileCodeGenerator Resources.Designer.cs @@ -95,4 +123,14 @@ + + + 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + + + + \ No newline at end of file diff --git a/OTP/key.db b/OTP/key.db new file mode 100644 index 0000000..c34521c Binary files /dev/null and b/OTP/key.db differ diff --git a/OTP/packages.config b/OTP/packages.config index d33de52..2cdfc1c 100644 --- a/OTP/packages.config +++ b/OTP/packages.config @@ -1,7 +1,13 @@  + + + + + + \ No newline at end of file