Best way to save values ​​/ configuration settings in Windows Phone 8

Since there is no default configuration file In a WP8 application, the best way to store configuration values, such as the WCF service URL, username, and password. I want these values ​​to be available and updated when the phone restarts and the application closes.

Thanks in advance.

+5
source share
2 answers

You must use IsolatedStorageSettings.ApplicationSettings.

Save value:

IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings;
appSettings.Add("email", "someone@contoso.com");
appSettings.Save();

Download value:

IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings;
string val = (string)appSettings["email"];

See the MSDN tutorial here: How to save and retrieve application settings using isolated storage . This is the Silverlight desktop, but it works the same on Windows Phone.

EDIT:

IsolatedStorageSettings.ApplicationSettings , ( @RichardSzalay ).

, IsolatedStorageSettings.ApplicationSettings Mutex.

: Windows Phone

+6

All Articles