Read a RTF File

T

Thomas Heiz

Which method is the best to read a RTF File in C#?

StreamReader sr = new StreamReader(filename,
System.Text.Encoding.GetEncoding(1252));
while((rtfContent = sr.ReadLine()) != null) { builder.Append(rtfContent); }
sr.Close();

Is it better to read a RTF file with sr.ReadLine() or sr.ReadToEnd(). The
result isn't the same, why?

Thanks for the help
Thomas Heiz
 
J

Joe

Which method is the best to read a RTF File in C#?

Do you want to parse the file, or do something simpler with it?
 
T

Thomas Heiz

I want to read the RTF file.
I use the method ReadToEnd(). I think the result is good enought
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top