vb.net - VB 2010 Arrays from TXT file -


I need to create a program that opens the text document and the new array for a string from txt for any line adds up. I try with this code but it does not work: New IO.StreamReader ("c: \ * .txt") as new list (string of) in the form of dim x ) O for each string as a. X in redundant () Add (A) Next

Can anyone help me? Thank you.

ReadToEnd () reads the whole file in a string, so you Loop lines will not be able to loop.

Make your life easier and

  string = file as the dim lines (). Read Line ("c: \" Myfile.txt ")   

It reads all the rows in a string array along with a line of code.


  slow line = Using new list (of the string) () reader = New Stream Reader ("C: \ MyFile.txt"), while not the reader. Add EndOffStream Lines (Reader.   

takes care of automatically shutting down the command reader.

Comments

Popular posts from this blog

Out of index C/C++ -

algorithm - Graph cut with python: How to set up the graph correctly? -

objective c - how Set autolayout for multiple dynamic buttons and labells in iOS? -