•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 425,819 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,031 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 503 | Replies: 1
![]() |
•
•
Join Date: Apr 2008
Posts: 19
Reputation:
Rep Power: 1
Solved Threads: 0
hey,I know the foll. Method to read the textfile line by line. & it is also working Fine. But I want to know that method which includes EOF(End Of File).
Can Somebody tell me that method.
Can Somebody tell me that method.
vb Syntax (Toggle Plain Text)
sFilename = "C:\Listview.txt" If Dir(sFilename.ToString) <> "" Then sFileReader = System.IO.File.OpenText(sFilename) sInputLine = sFileReader.ReadLine() Do Until sInputLine Is Nothing sInputLine = sFileReader.ReadLine() Loop End If
Last edited by Tekmaven : Jul 16th, 2008 at 3:05 am. Reason: Code tags
•
•
Join Date: Dec 2002
Location: West Virginia
Posts: 388
Reputation:
Rep Power: 6
Solved Threads: 40
How are saving sImputLine? As I see you are overwritting it with each read.
I use:
Now all your data is in an array.
I use:
Dim ary As String()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If My.Computer.FileSystem.FileExists("c:\test.txt") Then
Dim str As String = My.Computer.FileSystem.ReadAllText("c:\test.txt")
str.Split(ary, vbNewLine)
End If
End Sub Wayne
It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
![]() |
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Use line by line from a textfile. (C++)
- Read Textfile new line? (Visual Basic 4 / 5 / 6)
- Phonebook program! (C)
- Getting an array from a txt file (C)
- newbie needs help, basic mfc stuff (C++)
- How to read in a sentence and insert in to linked list? (C++)
- Text File Input and manipulation (C++)
Other Threads in the VB.NET Forum
- Previous Thread: [Need Help with a Simple Calculator]
- Next Thread: How in save data from a text box into table at vb 2005


Linear Mode