Passwoordcreator: code
- Code van de control:
Public Class pwcreator
Private p_pw As String
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
Private Sub maakpw()
p_pw = ""
Dim aantaltekens As Integer = 7
Dim letter As String
Randomize()
For teller = 1 To aantaltekens
Dim lijst As String
lijst = "abcdefghijklmnopqrstuvwxyz0123456789,?;:/=+-_"
lijst &= UCase(lijst)
letter = Mid(lijst, Rnd() * lijst.Length, 1)
p_pw &= letter
Next teller
Label1.Text = p_pw
End Sub
Public ReadOnly Property paswoord()
Get
Return p_pw
End Get
End Property
Public Sub MaakPaswoord()
maakpw()
End Sub
Public Sub Copy()
Clipboard.SetText(p_pw)
End Sub
End Class
- Code van het formulier:
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Pwcreator1.MaakPaswoord()
MsgBox(Pwcreator1.paswoord)
Pwcreator1.Copy()
End Sub
- Terug naar de beschrijving van het het project.
[VBWeb index] - [Copyright]