CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: store data

  1. #1
    Join Date
    Sep 2009
    Posts
    15

    store data

    hi, I have a little program that when we click on a button it changes the color.
    I want to store that data that when i open the program again it shows the last color . How can i do this??

    thanks

  2. #2
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: store data

    I would use the Properties.Settings.

    http://msdn.microsoft.com/en-us/libr...69(VS.80).aspx
    ===============================
    My Blog

  3. #3
    Join Date
    Sep 2009
    Posts
    15

    Re: store data

    i prefer strore to a file. what do you sugest


    thanks

  4. #4
    Join Date
    Jun 2008
    Posts
    2,477

    Re: store data

    Quote Originally Posted by devilonline View Post
    i prefer strore to a file. what do you sugest


    thanks
    Ummm... it is a file, but you can write out the file yourself if you like. You can define your own serialization scheme or use .NET's.

  5. #5
    Join Date
    Dec 2009
    Posts
    22

    Re: store data

    XML and LINQ are really creat for that kind of stuff.
    Take a look at this: http://www.hookedonlinq.com/LINQtoXM...eOverview.ashx

    You could make an XML file looking somthink like this:

    <settings>
    <myButton color="blue" text="click me" />
    </settings>

    The great thing about these kind of files is that you can but alot of stuff into them, and have it organized neatly.
    You could also make an .ini-style file, but i think you would have to make your own parser for such a file.
    Last edited by jonlist; February 5th, 2010 at 10:59 PM. Reason: elaborated

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured