ElliottE4

Untitled

Apr 7th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.20 KB | None | 0 0
  1. Imports System.IO
  2.  
  3. Public Class IDcheck
  4.  
  5.     Public Function IDcheck(ByVal textfile As String, ByVal input As String) As Boolean
  6.  
  7.         Dim NewRecord As String 'creates a new string variable that will store the data in a record in the texfile
  8.         Dim Fields() As String 'creates a new string array to store each record with comma splits to identify each field
  9.         Dim temp As String 'creates a new string variable to store the first field in the currently viewed record
  10.  
  11.         Dim sr As New StreamReader(textfile) 'opens a new streamwreader to read the data in the member textfile
  12.  
  13.         While sr.Peek >= 0 'creates a loop for each line until the end of the file
  14.  
  15.  
  16.             NewRecord = sr.ReadLine 'the newrecord variable stores the data on the currently viewed line (record) in the text file
  17.             Fields = NewRecord.Split(",") 'the fields array stores each field in the record, by splitting the data at each comma
  18.  
  19.             temp = Decryption(Fields(0))
  20.  
  21.             If input = temp Then
  22.  
  23.                 Return True
  24.  
  25.             End If
  26.  
  27.         End While
  28.  
  29.         Return False
  30.  
  31.         sr.Close() 'closes streamreader to avoid data loss
  32.  
  33.     End Function
  34.  
  35.  
  36. End Class
  37.  
Add Comment
Please, Sign In to add comment