|
-
Jun 13th, 2004, 04:03 PM
#1
Thread Starter
Lively Member
reading text file?
if i have a text file how do i put the lines into an array?
edit: i wanna chek if its there, if not i wanna make it, if so i wanna load it.
Last edited by Synth3t1c; Jun 13th, 2004 at 04:06 PM.
-
Jun 13th, 2004, 04:51 PM
#2
Addicted Member
Go here and download this code : http://www.planet-source-code.com/vb...=121&lngWId=10
I had the same problem then i got the project that that link will give you.
Edit- it is in vb.net '02 version
 Originally Posted by randem
You think you are confused? Try reading what you wrote...
-
Jun 13th, 2004, 08:43 PM
#3
Lively Member
getting every line of the text file
VB Code:
Imports System.IO
Module Module1
Sub Main()
Dim s As New StreamReader("..\module1.vb")
Dim ss(0) As String
Dim i As Integer = 0
While Not s.Peek = -1
ReDim Preserve ss(i)
ss(i) = s.ReadLine
i += 1
End While
Dim sss As String
For Each sss In ss
Console.WriteLine(sss)
Next
End Sub
End Module
-
Jun 14th, 2004, 01:09 AM
#4
Member
Hi,
you must open the textfile with "Open" mode only. But don't forget to put the open statement in "try ... catch.... end try",
because if the file dosn't exist you will be kicked out of your programm 
bye
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|