View Single Post
Go4Expert Member
24Oct2009,16:25  
vlado_036's Avatar
I have an application that reads some text from file and store data in the array.
Here is the code :

TextReader tr = new StreamReader("file.dat");

CBook tmpBook;
int i = 0;

while (tr.Read() > 0)
{
tmpBook = new CBook();

tmpBook.Title = tr.ReadLine();
tmpBook.Autor = tr.ReadLine();
tmpBook.Rbr = Convert.ToInt32(tr.ReadLine());
....
}
tr.Close();

Problem is that Read() fuction takes the first char of line Title an when i ned to display the Title i have it without first letter.