且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用C#保存/加载RichTextBox内容以及其他数据

更新时间:2021-09-25 10:02:30

您可以加载/保存到MemoryStream以解决读取文件末尾的问题.看起来可能像这样:

You could load/save to a MemoryStream to solve your issue with reading to the end of the file. It could look like this:

  • 将文件加载到内存中
  • 将该文件的一部分(即richtextbox的内容)加载到MemoryStream中
  • 从该MemoryStream加载richtextbox内容

还是您想知道如何创建和解析文件以包含标题,内容和任何其他字段的不同部分?

Or are you wanting to know how you'd create and parse a file to contain different sections for the title, and the contents, and any other fields ?