質問

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