Hi, i use the following code to read a flat file faster than reading line by line, and I store its contents
into a RichTextBox that won't be seen.
The reason I use richtextbox is because I can iterate through its line items once its populated, do you know of a collection I can use instead of richtextbox because it's a form control and I'm not using this code in a form, plus I'm not sure it's a good practice.
Do you know of any collection i can use bcos I can't seem to dump a file into a string array or arraylist, I'd have to loop through the file which is slow.
Thanks.
into a RichTextBox that won't be seen.
Code:
RichTextBox rch = new RichTextBox();
StreamReader sr;
sr = new StreamReader(inputFilePath);
rch.Text = sr.ReadToEnd();
The reason I use richtextbox is because I can iterate through its line items once its populated, do you know of a collection I can use instead of richtextbox because it's a form control and I'm not using this code in a form, plus I'm not sure it's a good practice.
Do you know of any collection i can use bcos I can't seem to dump a file into a string array or arraylist, I'd have to loop through the file which is slow.
Thanks.