locked
Saving data and then reading the data RRS feed

  • Question

  • Hi,

    I'm working on an app and i want to store a few things:

    • a variable ( number )
    • a string ( saying that the button is enabled "true" or "false")

    I want this data to save and when the user closes the app and then re-opens it, I want the data back.
    Ive searched the web, but all of the procedures i found where only temporary.

    Important : this is being coded in Visual basic

    Thanks in advance


    • Edited by Ben132546 Saturday, December 7, 2013 5:44 PM
    Saturday, December 7, 2013 5:43 PM

Answers

  • Hi Ben132546,

    This documentation might be a good thing for you: Quickstart: Local app data (Windows Store apps using C#/VB/C++ and XAML) 

    Instead of temporary application data, local application data enables you to save the data and use it when the next time open the app. 

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Ben132546 Monday, December 9, 2013 12:57 PM
    Sunday, December 8, 2013 3:13 AM
    Moderator

All replies

  • Hi Ben132546,

    This documentation might be a good thing for you: Quickstart: Local app data (Windows Store apps using C#/VB/C++ and XAML) 

    Instead of temporary application data, local application data enables you to save the data and use it when the next time open the app. 

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Ben132546 Monday, December 9, 2013 12:57 PM
    Sunday, December 8, 2013 3:13 AM
    Moderator
  • If it is mostly stuff like "Window Positions" (wich is minor) or Connection Strings (wich rarely changed), the User and Application settings are a good place to look too:

    http://msdn.microsoft.com/en-us/library/bb397750.aspx

    They are stored someplaces that make sense in XML format, but overall you do not need to worry where they are saved - they just are.

    When picking a place to store information it is important to remmember that you are never guaranteed to have writeaccess to the programm folder (since XP) and that the Paths to User AppData and All Users AppData might change, so always ask windows where they are.


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    Sunday, December 8, 2013 3:26 AM