How can i load a .txt file as FlowDocument to put it in a RichTextBox?

其他提示

The following is a pretty simple method.

using (var fs = new FileStream(FileName, FileMode.OpenOrCreate))
{
     var range = new TextRange(Document.ContentStart, Document.ContentEnd);
     range.Load(fs, DataFormats.Text);
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top