i am just finishing off my first app in vb.net and i would just liek to make it a bit more easier to maintain in future.
I would need to fill an array which could be hundreds to thousands of lines long so adding to this would be easier by just adding a line to a text file.
I have searched through the fourm and all posts refer to more complex methods, how do you you just do a simple line by line text file to an array, and how would you call it in your method?
I know you would use the Streamreader to do this, though the posts on teh forum i have got this far.
Dim sr As New StreamReader("c:/example.txt")
Dim line As String
Do
line = sr.ReadLine()
'How do i populate the array here.
Loop Until line Is Nothing
sr.Close()
I am just unsure what i need to do to populate a part of the array, I think above where i have commented it is where I need to do this.
and will I call it any differently in my method?
it's 4:22am my time so can't say have not tried lol
.
any help would be greatly appreciated
I would need to fill an array which could be hundreds to thousands of lines long so adding to this would be easier by just adding a line to a text file.
I have searched through the fourm and all posts refer to more complex methods, how do you you just do a simple line by line text file to an array, and how would you call it in your method?
I know you would use the Streamreader to do this, though the posts on teh forum i have got this far.
Dim sr As New StreamReader("c:/example.txt")
Dim line As String
Do
line = sr.ReadLine()
'How do i populate the array here.
Loop Until line Is Nothing
sr.Close()
I am just unsure what i need to do to populate a part of the array, I think above where i have commented it is where I need to do this.
and will I call it any differently in my method?
it's 4:22am my time so can't say have not tried lol
any help would be greatly appreciated