How to make a Password Generator
Posted: Mon Sep 05, 2011 2:11 pm
Hello and Welcome to my first Tutorial
First I'm apologize for my bad English an now we beginning with my first tutorial:
We make in my first tutorial a Password Generator with 2 functions the first Function is a password generation with no special character the 2'nd with special character.
First we make a new Project i named it Password Generator
Now we make a Form with this Tools
1 Textbox
1 Button
1 Checkbox
Now we coming to the code. To make the Password we make two Functions the first Functions is the code without special character the 2'nd with special character.
First Functions
Here the special characters code in one:
Now this was my first Tutorial here i hope you like this Tutorial please give me Feedback!
First I'm apologize for my bad English an now we beginning with my first tutorial:
We make in my first tutorial a Password Generator with 2 functions the first Function is a password generation with no special character the 2'nd with special character.
First we make a new Project i named it Password Generator
Now we make a Form with this Tools
1 Textbox
1 Button
1 Checkbox
Now we coming to the code. To make the Password we make two Functions the first Functions is the code without special character the 2'nd with special character.
First Functions
Code: Select all
Now come the Functions with special characters but you can copy the first code but you write some more characters herePublic Function GenerateCode() As Object
Dim intRnd As Object
Dim intStep As Object
Dim strName As Object
Dim intNameLength As Object
Dim intLenght As Object
Dim strInputString As Object
strInputString = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
intLenght = Len(strInputString)
intNameLength = 10
Randomize()
strName = ""
For intStep = 1 To intNameLength
intRnd = Int((intLenght * Rnd()) + 1)
strName = strName & Mid(strInputString, intRnd, 1)
Next
GenerateCode = strName
End Function
Code: Select all
This is the code without special characters here are the code with: strInputString = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Code: Select all
You can make very more.... strInputString = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"§$%&/()=?`-_.,;<>|°^"
Here the special characters code in one:
Code: Select all
Now we have to Functions and now we can make a If queryPublic Function GenerateCodeSonder() As Object
Dim intRnd As Object
Dim intStep As Object
Dim strName As Object
Dim intNameLength As Object
Dim intLenght As Object
Dim strInputString As Object
strInputString = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ§$%&/()=?"
intLenght = Len(strInputString)
intNameLength = 10
Randomize()
strName = ""
For intStep = 1 To intNameLength
intRnd = Int((intLenght * Rnd()) + 1)
strName = strName & Mid(strInputString, intRnd, 1)
Next
GenerateCodeSonder = strName
End Function
Code: Select all
If Checkbox1.Checked Then
Textbox1.Text = GenerateCodeSonder()
Else
Textbox1.Text = GenerateCode()
End if
Now this was my first Tutorial here i hope you like this Tutorial please give me Feedback!