我正在为WP8开发,我需要存储自定义应用设置。我找到了func'ApplicationData',但WP8不支持它。你能帮助我吗?我想存储用户提供的永久变量。例如:
Country = UA
News = 1
等
答案 0 :(得分:1)
您可以使用Isolated Storage或ApplicationData.LocalSettings,如下所示:
var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
// Create a simple setting
localSettings.Values["exampleSetting"] = "Hello Windows";
// Read data from a simple setting
Object value = localSettings.Values["exampleSetting"];
if (value == null)
{
// No data
}
else
{
// Access data in value
}
// Delete a simple setting
localSettings.Values.Remove("exampleSetting");