Let the program remember the values of the variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • michaeldebruin
    New Member
    • Feb 2011
    • 134

    Let the program remember the values of the variables

    Hello,

    How can I make sure that variables remember their value? For example if someone uses an option of my program, the counter increases with one 1. But how can I make sure that the counter will remember when the program restart that his value is 1 and not 0. The same goes for a few strings like username and password. Those strings need to remember at any time what there value is.

    Thanks in advance.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Write it to a file. Or a registry. But if you're going to store a password, make sure you use a hash.

    Comment

    • michaeldebruin
      New Member
      • Feb 2011
      • 134

      #3
      I don't think a hash is really that neccesary, because I am going to store all the variables at the local computer. But can you give me an example (with some codes, I know how to create streams) how to write variable values in a file or registry and how to hash a password?

      Many thanks in advance

      Comment

      • GaryTexmo
        Recognized Expert Top Contributor
        • Jul 2009
        • 1501

        #4
        You can also look at this...

        Comment

        • Subin Ninan
          New Member
          • Sep 2010
          • 91

          #5
          Make use of settings file. http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx

          Comment

          Working...