Advertisement
Just_Tom

Untitled

Mar 24th, 2024
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VisualBasic 1.00 KB | Source Code | 0 0
  1. Private Function CorrectUsernamePassword() As Boolean
  2.     Dim UserPasFile As New StreamReader("UsernamePassword.txt", False)
  3.     Do Until UserPasFile.EndOfStream
  4.         Dim Line As String = UserPasFile.ReadLine()
  5.         If Line <> "" Then
  6.             Dim CommaIndex As Byte = Line.IndexOf(",")
  7.             If CommaIndex >= 0 Then
  8.                 If Line.Substring(0, CommaIndex) = txtUsernameLog.Text And Line.Substring(CommaIndex + 1, Line.Length - (CommaIndex + 1)) = Password Then
  9.                     Return True
  10.                 End If
  11.             End If
  12.         End If
  13.     Loop
  14.     UserPasFile.Close()
  15.     Return False
  16. End Function
  17. Private Sub RemoveDefaultData(ByRef TxtBoxChanged As TextBox, DefaultTxt As String)
  18.     If TxtBoxChanged.Text = DefaultTxt Then
  19.         TxtBoxChanged.Text = ""
  20.     End If
  21. End Sub
  22. Private Sub AddDefaultData(ByRef TxtBoxChanged As TextBox, DefaultTxt As String)
  23.     If TxtBoxChanged.Text = "" Then
  24.         TxtBoxChanged.Text = DefaultTxt
  25.     End If
  26. End Sub
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement