
Untitled
By: a guest on
Apr 28th, 2012 | syntax:
VB.NET | size: 1.21 KB | hits: 31 | expires: Never
Dim str As String
Dim password As String
Dim tf As Boolean
Dim i As Integer = 0
Dim j As Integer = 0
Dim StName(10) As String ' Maybe you defined this as a global variable
Dim StPass(10) As String ' maybe you defined this as a global variable too
Dim nread = New StreamReader("user.txt")
Do Until tf = True
str = nread.ReadLine()
If str <> "" Then
ReDim Preserve StName(i)
StName(i) = str
i += 1
End If
tf = nread.EndOfStream()
Loop
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
tf = False ' SET IT TO FALSE (ITS ALREADY TRUE SINCE THE PAST LOOP
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim pread = New StreamReader("password.txt")
Do Until tf = True
password = pread.ReadLine()
If password <> "" Then
ReDim Preserve StPass(j)
StPass(j) = password
j += 1
End If
tf = pread.EndOfStream()
Loop
MessageBox.Show(StPass(2)) ''works now :D