diff --git a/Password Manager/GeneratePassword.Designer.cs b/Password Manager/GeneratePassword.Designer.cs index 186a1cb..622f155 100644 --- a/Password Manager/GeneratePassword.Designer.cs +++ b/Password Manager/GeneratePassword.Designer.cs @@ -37,10 +37,10 @@ cancel = new Button(); SuspendLayout(); // - // textBox1 + // passwordName // passwordName.Location = new Point(12, 33); - passwordName.Name = "textBox1"; + passwordName.Name = "passwordName"; passwordName.PlaceholderText = "website.com"; passwordName.Size = new Size(156, 23); passwordName.TabIndex = 0; @@ -63,42 +63,43 @@ label2.TabIndex = 2; label2.Text = "Length"; // - // textBox2 + // passwordLength // passwordLength.Location = new Point(12, 77); - passwordLength.Name = "textBox2"; + passwordLength.Name = "passwordLength"; passwordLength.PlaceholderText = "16"; passwordLength.Size = new Size(156, 23); passwordLength.TabIndex = 3; // - // checkBox1 + // noSymbols // noSymbols.AutoSize = true; noSymbols.Location = new Point(12, 106); - noSymbols.Name = "checkBox1"; + noSymbols.Name = "noSymbols"; noSymbols.Size = new Size(89, 19); noSymbols.TabIndex = 4; noSymbols.Text = "No symbols"; noSymbols.UseVisualStyleBackColor = true; // - // button1 + // generate // generate.Location = new Point(93, 131); - generate.Name = "button1"; + generate.Name = "generate"; generate.Size = new Size(75, 23); generate.TabIndex = 5; generate.Text = "Generate"; generate.UseVisualStyleBackColor = true; generate.Click += Generate; // - // button2 + // cancel // cancel.Location = new Point(12, 131); - cancel.Name = "button2"; + cancel.Name = "cancel"; cancel.Size = new Size(75, 23); cancel.TabIndex = 6; cancel.Text = "Cancel"; cancel.UseVisualStyleBackColor = true; + cancel.Click += cancel_Click; // // GeneratePassword // diff --git a/Password Manager/GeneratePassword.cs b/Password Manager/GeneratePassword.cs index c2e627f..ec6814c 100644 --- a/Password Manager/GeneratePassword.cs +++ b/Password Manager/GeneratePassword.cs @@ -5,14 +5,14 @@ namespace Password_Manager public partial class GeneratePassword : Form { private string currentPath; - private string recipient; + private string recipient; public GeneratePassword(string name, string currentPath, string recipient) { InitializeComponent(); passwordName.Text = name; this.currentPath = currentPath; - this.recipient = recipient; + this.recipient = recipient; } public void Generate(object sender, EventArgs e) @@ -29,7 +29,7 @@ namespace Password_Manager File.WriteAllText( currentPath + $"\\{passwordName.Text}.gpg", PasswordGenerator.New( - recipient, + recipient, Convert.ToInt32(passwordLength.Text), noSymbols.Checked) ); @@ -44,5 +44,10 @@ namespace Password_Manager } } } + + private void cancel_Click(object sender, EventArgs e) + { + Close(); + } } }