StreamReader sr = new StreamReader(inFileName);
StreamWriter sw = new StreamWriter(outFileName);
string str = sr.ReadLine();
sw.WriteLine(str);
sr.Dispose();
sw.Dispose();
I´m getting always an error in the 'string str = sr.ReadLine();'
If I do not define the streamwriter, no error occurs;
anybody knows if there is any limitation using reader and writer at the same time ?
thanks for your suggestion;
the problem only occurs if I use the streamwriter; my application creats web pages based in a template; as they are not so big I tried to read the lines into a string array and after disposing the StreamReader I write into the file using a StreamWriter, and now is working.
any way thanks for your help; I´ll take a look in the Willliam solution