Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: VB.NET  |  size: 1.21 KB  |  hits: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         Dim str As String
  2.         Dim password As String
  3.         Dim tf As Boolean
  4.         Dim i As Integer = 0
  5.         Dim j As Integer = 0
  6.  
  7.         Dim StName(10) As String  ' Maybe you defined this as a global variable
  8.         Dim StPass(10) As String ' maybe you defined this as a global variable too
  9.  
  10.  
  11.         Dim nread = New StreamReader("user.txt")
  12.         Do Until tf = True
  13.             str = nread.ReadLine()
  14.  
  15.             If str <> "" Then
  16.                 ReDim Preserve StName(i)
  17.                 StName(i) = str
  18.  
  19.                 i += 1
  20.             End If
  21.             tf = nread.EndOfStream()
  22.         Loop
  23.  
  24.         '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  25.         tf = False ' SET IT TO FALSE (ITS ALREADY TRUE SINCE THE PAST LOOP
  26.         ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  27.  
  28.         Dim pread = New StreamReader("password.txt")
  29.         Do Until tf = True
  30.             password = pread.ReadLine()
  31.             If password <> "" Then
  32.                 ReDim Preserve StPass(j)
  33.                 StPass(j) = password
  34.                 j += 1
  35.             End If
  36.             tf = pread.EndOfStream()
  37.         Loop
  38.  
  39.  
  40.         MessageBox.Show(StPass(2)) ''works now :D