|
-
Nov 12th, 2003, 12:14 AM
#1
Thread Starter
New Member
abort statement
Is there a way to program a button on a form so that when it is clicked it aborts the whole program.
Here's the code I have for an OK button (validates what the user types in)
Dim sr As IO.StreamReader = IO.File.OpenText("password.txt")
Dim usernamebox, readusername As String
Dim passwordbox, readpassword As String
Dim lines As Integer
Dim form As New Login()
usernamebox = txtusername.Text.ToUpper
passwordbox = txtpassword.Text.ToUpper
Do While sr.Peek <> -1
readusername = sr.ReadLine.ToUpper
readpassword = sr.ReadLine.ToUpper
If readusername = usernamebox Then
MsgBox(readusername)
If readpassword = passwordbox Then
MsgBox(readpassword)
Exit Do
End If
End If
Loop
if (usernamebox = " ") or (passwordbox = " ")
abort statement here
End If
sr.Close()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|