Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim password As String, ch As Char
Dim i As Integer
Dim valid As Boolean = False
While Not Valid
password = InputBox("Please enter your password")
For i = 0 To password.Length - 1
ch = password.Chars(i)
If Not Char.IsLetterOrDigit(ch) Then
valid = True
Exit For
End If
Next
If valid Then
MsgBox("Your new password will be activated immediately!")
Else
MsgBox("Your new password must contain at least one special symbol!")
End If
End While
End Sub
No comments:
Post a Comment