Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Hey, I am looking for a way to save a few strings or integers as settings for an application, as well as multiple rich text files. I am looking to save all of this in one file and to have it be easy to retrieve each section of the file. Any suggestions? Thanks in advance for your help.
Posted

Yes, this would not be hard. Just create a text file with your app using StreamWriter and read it using StreamReader. Just create in your file certain tags. Loop through each char in the text file and when you find a tag, mark the index in a int valriable then find the ending tag. Ex: [ ] Mark that index and read the char's inbetween.

 

If it is what you want, use the end tag index and read the info inbetween it and the next tag or line.

 

You can do this any creative way you want. Just learn to create and manipulate text and to search through it.

C#
  • *Experts*
Posted

You could also [mshelp=ms-help://MS.MSDNQTR.2003FEB.1033/cpguide/html/cpovrserializingobjects.htm]use serialization[/mshelp] of a class that stores all the

settings and documents. To store the rich text files in the

class, just set some String properties to the RTF text you're

storing (RichTextBox.TextRTF, for example).

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

  • *Experts*
Posted
You might also save each textbox in an 1Darray, then serialize it, store it in a line format or a csv format, etc. I'm not the strongest at it but xml works also.

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Posted
Sorry to gate crash the thread. But am i right in thinking that serialization kind of export the current frame to a file - so you can reload it back at a later date?
  • *Experts*
Posted
Sorry to gate crash the thread. But am i right in thinking that serialization kind of export the current frame to a file - so you can reload it back at a later date?

Serialization is capturing the current state of any object that is marked as Serializable to the file so you can restore it later to excatly the same state.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...