Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Public Class IDcheck
- Public Function IDcheck(ByVal textfile As String, ByVal input As String) As Boolean
- Dim NewRecord As String 'creates a new string variable that will store the data in a record in the texfile
- Dim Fields() As String 'creates a new string array to store each record with comma splits to identify each field
- Dim temp As String 'creates a new string variable to store the first field in the currently viewed record
- Dim sr As New StreamReader(textfile) 'opens a new streamwreader to read the data in the member textfile
- While sr.Peek >= 0 'creates a loop for each line until the end of the file
- NewRecord = sr.ReadLine 'the newrecord variable stores the data on the currently viewed line (record) in the text file
- Fields = NewRecord.Split(",") 'the fields array stores each field in the record, by splitting the data at each comma
- temp = Decryption(Fields(0))
- If input = temp Then
- Return True
- End If
- End While
- Return False
- sr.Close() 'closes streamreader to avoid data loss
- End Function
- End Class
Add Comment
Please, Sign In to add comment