vb.net - When I try to Login as a Teacher I get the error : EndOfStreamException Unhandled -


Here is the code for the teacher login, where run once and try to login a valid account to the system If error is done: endofstream expansion will not be compromised

Any help would be appreciated

  Private Sub BTTYOnGinCalik (ByVal sender as System.Object, By Value A Like Systems.AventArgS) Handles BTNTOgin. Click if TxtUsername.Text = "" or TxtPasswo rd.Text = "" Then enter the MsgBox ("Please enter all login details for the account") if the 'filename =' educator ACCaccount.txt "FileOpenStatusT = Incorrect slow file Boolean filefilefile = False fileOpen (1, filename , OpenModa.Input) while Filefound = Incorrect input (1, username) Input (1, password) Input (1, notet) input (1, surname) if user name = TxtUsername.Text and password = TxtPassword.Text Filefound = True End if finished, then Filefound = False Then MsgBox ("Username and Pass Word matches were not, please try again ") Other teachers Menu.Show () Me.Hide () End If FileClose (1) End Sub    

There are some potential problems with the code people I see may be related to your problem:

  If TxtUsername.Text = "" or TxtPassword.Text = "" then the MsgBox ("Please" all login details for the account ") end if '  

either the text box If empty, this message box will display, but then empty user Program or file will continue to try to view the password. Filefound = False input (1, user name) Input (1, password) Input (1, namet) Input form Boolean filefound = False FileOpen (1, Filenamet, OpenMode.Input) Dim filefound Dim

 (1, surnamet) if the user name = TxtUsername.Text and password = TxtPassword.Text then Filefound = True End is finished, if Filefound = False ...   

Filefound will never be incorrect at the end of that time-loop Either a match will be found, so is filename is true , or no match will be found. Since there is no final check of the file, it may be possible in the endoffreme exception that you are seeing since you are using the old file system methods, so you can check that the file At the end, you can use EOF (1).

Your best bet might be a move through the loop, to see what you expect, what you expect, read usernames and Check the password variable. for reading.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -