문제

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