Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 156001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:15:18+00:00 2026-05-11T10:15:18+00:00

I am currently trying to figure out how to save the content from a

  • 0

I am currently trying to figure out how to save the content from a RichTextbox into a stream(currently using FileStream) and do this alongside a bunch of other data. Then of course I want to be able to load from this file. I was currently trying to use something along the following lines.

FileStream stream = new FileStream(); //this is actually correctly defined. ASCIIEncoding encoding = new ASCIIEncoding();  //write Title byte[] array = encoding.GetBytes(Title); stream.WriteByte(Convert.ToByte(array.Length)); stream.Write(array, 0, array.Length);  //save textRange textRange.Save(stream, System.Windows.DataFormats.Rtf);  //write Subtitle byte[] array = encoding.GetBytes(Subtitle); stream.WriteByte(Convert.ToByte(array.Length)); stream.Write(array, 0, array.Length); //ect...and something very similar for Loading a file. 

This is basically what I am trying to do. I am actually saving 2 TextRanges and a bunch more Properties. So my problem is that TextRange.Load() reads to the end of the file…making it impossible for me to use that considering I have 2 TextRanges I need to save/load. So here I am trying to come up with another way to be able to save/load the content of a RichTextBox with other data. I dont have to use a Stream. I am pretty much open to any feasible solutions. Thanks in advance!

~Jasson

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:15:18+00:00Added an answer on May 11, 2026 at 10:15 am

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

    • Load your file into memory
    • Load the section of that file that is the contents of the richtextbox into a MemoryStream
    • Load the richtextbox contents from that MemoryStream

    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 ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to figure out KendoUI. I am using version 2012.1.322. I
I am trying to figure out how to save a NSDate value into my
I've spent a bunch of time trying to figure this problem out and had
I am currently trying to figure out how you can bind multiple fields in
I'm trying to figure out if I'm using the DAO pattern correctly and, more
I am currently building a Rails app, and trying to figure out the best
I can't seem to figure out how to do this. I am trying to
I am currently trying to figure out how to update documents in MongoDb via
I'm trying to figure out if it's possible to save a jpeg as an
I've searching forever trying to figure out why IE will not save the current

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.