Save user input from previous session for next session

  • Thread starter Thread starter muscleking
  • Start date Start date
M

muscleking

say i have a form with many input text boxes, what is the proper way to store
these values so when the next time the user opens the form, all the input
from last session remains in the form? people recommend me to have a "cookie"
file or registry to read and write from every time. but is there an easier
way to do this, such as a feature in the .NET forms that i haven't found out
yet.

thank you
 
say i have a form with many input text boxes, what is the proper way to store
these values so when the next time the user opens the form, all the input
from last session remains in the form? people recommend me to have a "cookie"
file or registry to read and write from every time. but is there an easier
way to do this, such as a feature in the .NET forms that i haven't found out
yet.

thank you

Hi,
If you have to close and re-launch your application(because storing
information in variables is useless here as well), you can consider
serializing XML or storing in simple text files. There are sutiable
classes in .NET for saving / reading both. (XMLreader/Writer,
StreamReader/Writer etc.)

Or you can consider My.Settings to store and have the same information/
settings after you re-run your application:
http://msdn.microsoft.com/en-us/library/ms379611(VS.80).aspx

Hope these help,

Onur Güzel
 
muscleking said:
say i have a form with many input text boxes, what is the proper way to
store
these values so when the next time the user opens the form, all the input
from last session remains in the form? people recommend me to have a
"cookie"
file or registry to read and write from every time. but is there an easier
way to do this, such as a feature in the .NET forms that i haven't found
out
yet.

In the control's property window in the IDE select "(ApplicationSettings)"
and create property bindings via "(PropertyBinding)" for the relevant
properties. The property values are then stored in the user settings
without the need for a single line of custom code.
 
Back
Top