-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
45 lines (41 loc) · 1.22 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using PasswUtils;
using System.Windows.Forms;
namespace pwgentoo
{
public partial class Form1 : Form
{
int i = 0;
public Form1()
{
InitializeComponent();
}
private void AddPassword()
{
string pass = PasswordUtils.GenerateStrongPass(Convert.ToInt32(edPasswordLen.Text), chUsePunktuation.Checked, chUseEntropy.Checked);
if (chStrongly.Checked)
{
pass += " " + Convert.ToString(PasswordUtils.TestPasswordWeak(pass, ""));
}
moPasswords.Text += pass + Environment.NewLine;
}
private void button1_Click(object sender, EventArgs e)
{
if (chClear.Checked)
moPasswords.Clear();
i = Convert.ToInt32(edCountPosswords.Text);
moPasswords.Text += "----------" + Environment.NewLine;
timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (i > 0)
{
AddPassword();
i--;
}
else
timer1.Enabled = false;
}
}
}