Click here to Skip to main content
15,927,745 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionREAD TEXT FILE LINE BY LINE AND STORE ALL LINES IN ARRAY...(is a good idea?) Pin
sal2123-Nov-08 6:12
sal2123-Nov-08 6:12 
AnswerRe: READ TEXT FILE LINE BY LINE AND STORE ALL LINES IN ARRAY...(is a good idea?) Pin
Paul Conrad23-Nov-08 6:34
professionalPaul Conrad23-Nov-08 6:34 
GeneralRe: READ TEXT FILE LINE BY LINE AND STORE ALL LINES IN ARRAY...(is a good idea?) Pin
sal2123-Nov-08 7:29
sal2123-Nov-08 7:29 
GeneralRe: READ TEXT FILE LINE BY LINE AND STORE ALL LINES IN ARRAY...(is a good idea?) Pin
Guffa23-Nov-08 13:26
Guffa23-Nov-08 13:26 
GeneralRe: READ TEXT FILE LINE BY LINE AND STORE ALL LINES IN ARRAY...(is a good idea?) Pin
Paul Conrad24-Nov-08 5:59
professionalPaul Conrad24-Nov-08 5:59 
GeneralRe: READ TEXT FILE LINE BY LINE AND STORE ALL LINES IN ARRAY...(is a good idea?) Pin
Jon_Boy24-Nov-08 6:29
Jon_Boy24-Nov-08 6:29 
GeneralRe: READ TEXT FILE LINE BY LINE AND STORE ALL LINES IN ARRAY...(is a good idea?) Pin
Paul Conrad24-Nov-08 6:37
professionalPaul Conrad24-Nov-08 6:37 
GeneralRe: we prefer lower-case Pin
Luc Pattyn23-Nov-08 15:40
sitebuilderLuc Pattyn23-Nov-08 15:40 
Hi,

sal21 wrote:
is a good idea?


No!

File.ReadAllLines will read the file and give you the huge array you are looking for;
however generating such a huge array will be detrimental to the performance of your app, no matter how you do it.

If a single pass through the file is all you need, have a look at streams. If you only need a fraction of the file's content, read it line by line, don't store all the lines, simply store the pieces you need (use StreamReader.ReadLine)

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Fixturized forever. Confused | :confused:


AnswerRe: READ TEXT FILE LINE BY LINE AND STORE ALL LINES IN ARRAY...(is a good idea?) Pin
Jon_Boy24-Nov-08 6:05
Jon_Boy24-Nov-08 6:05 
QuestionMicrosoft.DirectX.DirectInput Pin
Derek Pescod23-Nov-08 6:10
Derek Pescod23-Nov-08 6:10 
AnswerRe: Microsoft.DirectX.DirectInput Pin
Paul Conrad23-Nov-08 6:41
professionalPaul Conrad23-Nov-08 6:41 
GeneralRe: Microsoft.DirectX.DirectInput Pin
Derek Pescod23-Nov-08 10:00
Derek Pescod23-Nov-08 10:00 
GeneralRe: Microsoft.DirectX.DirectInput Pin
Paul Conrad23-Nov-08 16:03
professionalPaul Conrad23-Nov-08 16:03 
AnswerRe: Microsoft.DirectX.DirectInput Pin
Luc Pattyn23-Nov-08 16:27
sitebuilderLuc Pattyn23-Nov-08 16:27 
AnswerRe: Microsoft.DirectX.DirectInput Pin
Derek Pescod25-Nov-08 12:10
Derek Pescod25-Nov-08 12:10 
QuestionHow to execute javascript function from BHO Pin
MAP Tiger23-Nov-08 6:00
MAP Tiger23-Nov-08 6:00 
QuestionCrystal Report 9 not run in anthor computer Pin
D.Manivelan22-Nov-08 20:21
D.Manivelan22-Nov-08 20:21 
AnswerRe: Crystal Report 9 not run in anthor computer Pin
Christian Graus22-Nov-08 22:33
protectorChristian Graus22-Nov-08 22:33 
AnswerRe: Crystal Report 9 not run in anthor computer Pin
Dave Kreskowiak23-Nov-08 5:20
mveDave Kreskowiak23-Nov-08 5:20 
AnswerRe: Crystal Report 9 not run in anthor computer Pin
MAP Tiger23-Nov-08 7:04
MAP Tiger23-Nov-08 7:04 
QuestionImage Editor Pin
Gagan.2022-Nov-08 1:42
Gagan.2022-Nov-08 1:42 
AnswerRe: Image Editor Pin
Dave Kreskowiak22-Nov-08 4:40
mveDave Kreskowiak22-Nov-08 4:40 
GeneralRe: Image Editor Pin
Gagan.2022-Nov-08 16:30
Gagan.2022-Nov-08 16:30 
QuestionHow to Visual Basic 2008 is captured in the camera video? Pin
liaowenbo21-Nov-08 20:29
liaowenbo21-Nov-08 20:29 
AnswerRe: How to Visual Basic 2008 is captured in the camera video? PinPopular
Christian Graus21-Nov-08 20:50
protectorChristian Graus21-Nov-08 20:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.