
07-10-2012, 11:29 AM
|
 |
Multi-Technologist
Super Moderator * Expert *
|
|
Join Date: May 2004
Location: Michigan
Posts: 3,739
|
|
How are the lines terminated? The following works fine for me:
Code:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim arrIP() As String
Dim arrUsername() As String
Dim arrPassword() As String
Dim LoopCount As Integer
Dim IP As String
Dim Username As String
Dim Password As String
FileOpen(1, "C:\temps.txt", OpenMode.Output, OpenAccess.Write, OpenShare.Default)
Print(1, "10.10.10.2" & vbCrLf)
Print(1, "Me" & vbCrLf)
Print(1, "MePass" & vbCrLf)
Print(1, "10.10.10.3" & vbCrLf)
Print(1, "You" & vbCrLf)
Print(1, "YouPass" & vbCrLf)
FileClose(1)
FileOpen(1, "C:\temps.txt", OpenMode.Input, OpenAccess.Read, OpenShare.Default)
While EOF(1) = False
ReDim Preserve arrIP(LoopCount), arrUsername(LoopCount), arrPassword(LoopCount)
IP = LineInput(1)
Username = LineInput(1)
Password = LineInput(1)
arrIP(LoopCount) = IP
arrUsername(LoopCount) = Username
arrPassword(LoopCount) = Password
LoopCount = LoopCount + 1
Label1.Text = LoopCount
End While
FileClose(1)
Me.Close()
End Sub
End Class
|
__________________
"May the code that you write never work in ways that you didn't expect; and may the code that you didn't write never require you to maintain it". - Ancient Chinese Proverb
|