This password generator makes it easy and safe to generate random passwords for strong security.This will generate highly secure passwords that are difficult to crack or guess. In this program you can generate strong password random with length 20 combinations and copy to the clipboard. You can use uppercase letters and lowercase letters, numbers and special characters. You can generate from minimum 6 and maximum 20 combinations length. Show strong password by colors like advanced, high, normal, low. You can choose time to delete password of the clipboard, from 10 to 60 seconds.
Imports System
Public Class Generator
Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
CheckBox7.Checked = False
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
TextBox1.Text = ""
Button3.Hide()
ToolTip1.SetToolTip(Button3, "Copy")
ToolTip1.IsBalloon = True
NumericUpDown1.Minimum = 6
Label3.Text = "Weak"
Label1.Show()
Label3.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If CheckBox7.Checked = False Then
TextBox1.PasswordChar = "?"
Else
CheckBox7.Checked = True
TextBox1.PasswordChar.ToString()
End If
NumericUpDown1.Minimum = 6
Dim num As String
Dim abc As String
Dim letrasnum As String
Dim Letra As String
If NumericUpDown1.Value = 6 Then
num = Randompass.Generate(6)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(6)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(6)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(6)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(6)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 7 Then
num = Randompass.Generate(7)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(7)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(7)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(7)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(7)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 8 Then
num = Randompass.Generate(8)
If RadioButton1.Checked = True Then
num = Numr.Generate(8)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(8)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(8)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(8)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 9 Then
num = Randompass.Generate(9)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(9)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(9)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(9)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(9)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 10 Then
num = Randompass.Generate(10)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(10)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(10)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(10)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(10)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 11 Then
num = Randompass.Generate(11)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(11)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(11)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(11)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(11)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 12 Then
num = Randompass.Generate(12)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(12)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(12)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(12)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(12)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 13 Then
num = Randompass.Generate(13)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(13)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(13)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(13)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(13)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 14 Then
num = Randompass.Generate(14)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(14)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(14)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(14)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(14)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 15 Then
num = Randompass.Generate(15)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(15)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(15)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(15)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(15)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 16 Then
num = Randompass.Generate(16)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(16)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(16)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(16)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(16)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 17 Then
num = Randompass.Generate(17)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(17)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(17)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(17)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(17)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 18 Then
num = Randompass.Generate(18)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(18)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(18)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(18)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(18)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 19 Then
num = Randompass.Generate(19)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(19)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(19)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(19)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(19)
TextBox1.Text = (Letra)
End If
ElseIf NumericUpDown1.Value = 20 Then
num = Randompass.Generate(20)
TextBox1.Text = (num)
If RadioButton1.Checked = True Then
num = Numr.Generate(20)
TextBox1.Text = (num)
ElseIf RadioButton2.Checked = True Then
abc = Randompass.Generate(20)
TextBox1.Text = (abc)
ElseIf RadioButton3.Checked = True Then
letrasnum = LetrasNumeros.Generate(20)
TextBox1.Text = (letrasnum)
ElseIf RadioButton4.Checked = True Then
Letra = Letraspl.Generate(20)
TextBox1.Text = (Letra)
End If
End If
NumericUpDown1.Maximum = 20
Button3.Show()
End Sub
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
If TextBox1.Text = "" Then
TextBox1.Clear()
End If
If CheckBox7.Checked = True Then
TextBox1.PasswordChar = String.Empty
Else
CheckBox7.Checked = False
TextBox1.PasswordChar = "?"
End If
If CheckBox1.Checked = True Then
Clipboard.SetDataObject(TextBox1.Text, True)
Timer3.Start()
Timer1.Enabled = True
Timer1.Start()
Timer1.Interval = 10000
Mostra.Show()
Button1.Enabled = False
Button3.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
CheckBox4.Enabled = False
CheckBox5.Enabled = False
CheckBox6.Enabled = False
Timer2.Enabled = True
Timer2.Start()
Timer2.Interval = 13000
ElseIf CheckBox2.Checked = True Then
Clipboard.SetDataObject(TextBox1.Text, True)
Timer3.Start()
Timer1.Enabled = True
Timer1.Start()
Timer1.Interval = 20000
Mostra.Show()
Button1.Enabled = False
Button3.Enabled = False
CheckBox1.Enabled = False
CheckBox3.Enabled = False
CheckBox4.Enabled = False
CheckBox5.Enabled = False
CheckBox6.Enabled = False
Timer2.Enabled = True
Timer2.Start()
Timer2.Interval = 23000
ElseIf CheckBox3.Checked = True Then
Clipboard.SetDataObject(TextBox1.Text, True)
Timer3.Start()
Timer1.Enabled = True
Timer1.Start()
Timer1.Interval = 30000
Mostra.Show()
Button1.Enabled = False
Button3.Enabled = False
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox4.Enabled = False
CheckBox5.Enabled = False
CheckBox6.Enabled = False
Timer2.Enabled = True
Timer2.Start()
Timer2.Interval = 33000
ElseIf CheckBox4.Checked = True Then
Clipboard.SetDataObject(TextBox1.Text, True)
Timer3.Start()
Timer1.Enabled = True
Timer1.Start()
Timer1.Interval = 40000
Mostra.Show()
Button1.Enabled = False
Button3.Enabled = False
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
CheckBox5.Enabled = False
CheckBox6.Enabled = False
Timer2.Enabled = True
Timer2.Start()
Timer2.Interval = 43000
ElseIf CheckBox5.Checked = True Then
Clipboard.SetDataObject(TextBox1.Text, True)
Timer3.Start()
Timer1.Enabled = True
Timer1.Start()
Timer1.Interval = 50000
Mostra.Show()
Button1.Enabled = False
Button3.Enabled = False
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
CheckBox4.Enabled = False
CheckBox6.Enabled = False
Timer2.Enabled = True
Timer2.Start()
Timer2.Interval = 53000
ElseIf CheckBox6.Checked = True Then
Clipboard.SetDataObject(TextBox1.Text, True)
Timer3.Start()
Timer1.Start()
Timer1.Interval = 60000
Mostra.Show()
Button1.Enabled = False
Button3.Enabled = False
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
CheckBox4.Enabled = False
CheckBox5.Enabled = False
Timer2.Enabled = True
Timer2.Start()
Timer2.Interval = 63000
Button1.Enabled = False
Else
If CheckBox1.Checked = False And CheckBox2.Checked = False And CheckBox3.Checked = False And CheckBox4.Checked = False And CheckBox5.Checked = False And CheckBox6.Checked = False Then
MessageBox.Show("Please select a time to delete the password.", "Password Generator", MessageBoxButtons.OK, MessageBoxIcon.Warning)
My.Computer.Clipboard.Clear()
End If
End If
End Sub
Private Sub NumericUpDown1_ValueChanged(sender As System.Object, e As System.EventArgs) Handles NumericUpDown1.ValueChanged
NumericUpDown1.Minimum = 6
If NumericUpDown1.Value = 6 Then
TextBox1.Visible = True
Label3.ForeColor = Color.Red
Label3.Text = "Weak"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 7 Then
TextBox1.Visible = True
Label3.ForeColor = Color.Red
Label3.Text = "Weak"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 8 Then
TextBox1.Visible = True
Label3.ForeColor = Color.Red
Label3.Text = "Weak"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 9 Then
TextBox1.Visible = True
Label3.ForeColor = Color.Maroon
Label3.Text = "Normal"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 10 Then
TextBox1.Visible = True
Label3.ForeColor = Color.Maroon
Label3.Text = "Normal"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 11 Then
TextBox1.Visible = True
Label3.ForeColor = Color.Maroon
Label3.Text = "Normal"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 12 Then
TextBox1.Visible = True
Label3.ForeColor = Color.DarkOrange
Label3.Text = "Advanced"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 13 Then
TextBox1.Visible = True
Label3.ForeColor = Color.DarkOrange
Label3.Text = "Advanced"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 14 Then
TextBox1.Visible = True
Label3.ForeColor = Color.DarkOrange
Label3.Text = "Advanced"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 15 Then
TextBox1.Visible = True
Label3.ForeColor = Color.DarkOrange
Label3.Text = "Advanced"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 16 Then
TextBox1.Visible = True
Label3.ForeColor = Color.DarkOrange
Label3.Text = "Advanced"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 17 Then
TextBox1.Visible = True
Label3.ForeColor = Color.DarkOrange
Label3.Text = "Advanced"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 18 Then
TextBox1.Visible = True
Label3.ForeColor = Color.Green
Label3.Text = "High"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 19 Then
TextBox1.Visible = True
Label3.ForeColor = Color.Green
Label3.Text = "High"
Label1.Show()
Label3.Show()
ElseIf NumericUpDown1.Value = 20 Then
TextBox1.Visible = True
Label3.ForeColor = Color.Green
Label3.Text = "High"
Label1.Show()
Label3.Show()
End If
NumericUpDown1.Maximum = 20
End Sub
Private Sub RadioButton1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton1.CheckedChanged
TextBox1.Visible = True
End Sub
Private Sub RadioButton2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton2.CheckedChanged
TextBox1.Visible = True
End Sub
Private Sub RadioButton3_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton3.CheckedChanged
TextBox1.Visible = True
End Sub
Private Sub RadioButton4_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton4.CheckedChanged
TextBox1.Visible = True
End Sub
Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged
CheckBox2.Checked = False
CheckBox3.Checked = False
CheckBox4.Checked = False
CheckBox5.Checked = False
CheckBox6.Checked = False
End Sub
Private Sub CheckBox2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox2.CheckedChanged
CheckBox1.Checked = False
CheckBox3.Checked = False
CheckBox4.Checked = False
CheckBox5.Checked = False
CheckBox6.Checked = False
End Sub
Private Sub CheckBox3_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox3.CheckedChanged
CheckBox1.Checked = False
CheckBox2.Checked = False
CheckBox4.Checked = False
CheckBox5.Checked = False
CheckBox6.Checked = False
End Sub
Private Sub CheckBox4_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox4.CheckedChanged
CheckBox1.Checked = False
CheckBox2.Checked = False
CheckBox3.Checked = False
CheckBox5.Checked = False
CheckBox6.Checked = False
End Sub
Private Sub CheckBox5_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox5.CheckedChanged
CheckBox1.Checked = False
CheckBox2.Checked = False
CheckBox3.Checked = False
CheckBox4.Checked = False
CheckBox6.Checked = False
End Sub
Private Sub CheckBox6_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox6.CheckedChanged
CheckBox1.Checked = False
CheckBox2.Checked = False
CheckBox3.Checked = False
CheckBox4.Checked = False
CheckBox5.Checked = False
End Sub
Private Sub CheckBox7_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox7.CheckedChanged
If CheckBox7.Checked = True Then
TextBox1.PasswordChar = String.Empty
Else
CheckBox7.Checked = False
TextBox1.PasswordChar = "?"
End If
If TextBox1.Text = "" Then
Button3.Hide()
End If
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
If Timer1.Interval <= 10000 Then
TextBox1.SelectAll()
TextBox1.Copy()
Clipboard.SetDataObject(TextBox1.Text, True)
Mostrar2.Show()
Timer1.Stop()
ElseIf Timer1.Interval <= 20000 Then
TextBox1.SelectAll()
TextBox1.Copy()
Clipboard.SetDataObject(TextBox1.Text, True)
Mostrar2.Show()
Timer1.Stop()
ElseIf Timer1.Interval <= 30000 Then
TextBox1.SelectAll()
TextBox1.Copy()
Clipboard.SetDataObject(TextBox1.Text, True)
Mostrar2.Show()
Timer1.Stop()
ElseIf Timer1.Interval <= 40000 Then
TextBox1.SelectAll()
TextBox1.Copy()
Clipboard.SetDataObject(TextBox1.Text, True)
Mostrar2.Show()
Timer1.Stop()
ElseIf Timer1.Interval <= 50000 Then
TextBox1.SelectAll()
TextBox1.Copy()
Clipboard.SetDataObject(TextBox1.Text, True)
Mostrar2.Show()
Timer1.Stop()
ElseIf Timer1.Interval <= 60000 Then
TextBox1.SelectAll()
TextBox1.Copy()
Clipboard.SetDataObject(TextBox1.Text, True)
Mostrar2.Show()
Timer1.Stop()
End If
End Sub
Private Sub Timer2_Tick(sender As System.Object, e As System.EventArgs) Handles Timer2.Tick
If Timer2.Interval = 13000 Then
Timer2.Stop()
My.Computer.Clipboard.Clear()
Mostrar2.Hide()
Button1.Enabled = True
Button3.Enabled = True
CheckBox2.Enabled = True
CheckBox3.Enabled = True
CheckBox4.Enabled = True
CheckBox5.Enabled = True
CheckBox6.Enabled = True
ElseIf Timer2.Interval = 23000 Then
Timer2.Stop()
My.Computer.Clipboard.Clear()
Mostrar2.Hide()
Button1.Enabled = True
Button3.Enabled = True
CheckBox1.Enabled = True
CheckBox3.Enabled = True
CheckBox4.Enabled = True
CheckBox5.Enabled = True
CheckBox6.Enabled = True
ElseIf Timer2.Interval = 33000 Then
Timer2.Stop()
My.Computer.Clipboard.Clear()
Mostrar2.Hide()
Button1.Enabled = True
Button3.Enabled = True
CheckBox1.Enabled = True
CheckBox2.Enabled = True
CheckBox4.Enabled = True
CheckBox5.Enabled = True
CheckBox6.Enabled = True
ElseIf Timer2.Interval = 43000 Then
Timer2.Stop()
My.Computer.Clipboard.Clear()
Mostrar2.Hide()
Button1.Enabled = True
Button3.Enabled = True
CheckBox1.Enabled = True
CheckBox2.Enabled = True
CheckBox3.Enabled = True
CheckBox5.Enabled = True
CheckBox6.Enabled = True
ElseIf Timer2.Interval = 53000 Then
Timer2.Stop()
My.Computer.Clipboard.Clear()
Mostrar2.Hide()
Button1.Enabled = True
Button3.Enabled = True
CheckBox1.Enabled = True
CheckBox2.Enabled = True
CheckBox3.Enabled = True
CheckBox4.Enabled = True
CheckBox6.Enabled = True
ElseIf Timer2.Interval = 63000 Then
Timer2.Stop()
My.Computer.Clipboard.Clear()
Mostrar2.Hide()
Button1.Enabled = True
Button3.Enabled = True
CheckBox1.Enabled = True
CheckBox2.Enabled = True
CheckBox3.Enabled = True
CheckBox4.Enabled = True
CheckBox5.Enabled = True
End If
End Sub
Private Sub Timer3_Tick(sender As System.Object, e As System.EventArgs) Handles Timer3.Tick
If Timer3.Interval = 5000 Then
Timer3.Stop()
Mostra.Hide()
End If
End Sub
End Class