Save user input from previous session for next session

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?bXVzY2xla2luZw==?=

    Save user input from previous session for next session

    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
  • kimiraikkonen

    #2
    Re: Save user input from previous session for next session

    On Jun 6, 9:01 pm, muscleking <musclek...@dis cussions.micros oft.com>
    wrote:
    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(bec ause 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:


    Hope these help,

    Onur Güzel

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Save user input from previous session for next session

      "muscleking " <muscleking@dis cussions.micros oft.comschrieb:
      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 "(ApplicationSe ttings)"
      and create property bindings via "(PropertyBindi ng)" for the relevant
      properties. The property values are then stored in the user settings
      without the need for a single line of custom code.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      Working...