vb.net - Visual Basic - Object reference not set to an instance of an object -
I get the following error in VB.Net.
"Object reference is not a set example of an object"
This highlights "Next" at the end of the loop.
Any help would be great.
Importing System IO Public Class Login Form Dim User Name String Dempace Password () as String Dim Index As String Dim Index Integer Public Function Encrypt ) String in the form of a dim = "I" I am the integer data = RTrim (data) as if the middle (data, 1, 1)
Try changing this code:
for each user name if UserNameTextBox.Text = Username (index) then UserAdd.Show () Me.Hide () if PasswordTextBox.Text = Password (Index) then MessageBox.Show ( "Correct password") Otherwise MessageBox ("Invalid Password, Sorry") if otherwise: MessageBox.Show ("invalid user name, sorry") ends, then next
< / Pre>With this code:
If the user name (i) is not meaningless, then for every username it is not futile if the user name is testbox. Text = Username (index) then UsageAud Show () Me.Hide () if PasswordTaxbox. Text = password (index) then message box ("Invalid Password") either MessageBox.Show ("Invalid Password, Sorry") if it ends otherwise: MessageBox.Show ("Invalid user name, sorry") end if other .... empty string end to Take care if next
Comments
Post a Comment