12-22-2009, 12:36 AM
05-20-2011, 01:27 PM
I have one code that you can use this code into your Main method for a console window.
This sample requires some form of a text (.txt) file from which to read.
int counter = 0;
string line;
System.IO.StreamReader file =
new System.IO.StreamReader("c:\\test.txt");
while((line = file.ReadLine()) != null)
{
Console.WriteLine (line);
counter++;
}
file.Close();
Console.ReadLine();
This sample requires some form of a text (.txt) file from which to read.
int counter = 0;
string line;
System.IO.StreamReader file =
new System.IO.StreamReader("c:\\test.txt");
while((line = file.ReadLine()) != null)
{
Console.WriteLine (line);
counter++;
}
file.Close();
Console.ReadLine();
06-09-2011, 04:52 AM
For reading line by line of richtextbox use the bellow code that may help you
foreach (string line in richTextBox1.Lines)
{
label1.Text = label1.Text.ToString() + line + Environment.NewLine;
}
I think it will be work.
foreach (string line in richTextBox1.Lines)
{
label1.Text = label1.Text.ToString() + line + Environment.NewLine;
}
I think it will be work.