我正在尝试使用 Xamarin 的 Mono 东西(MonoTouch 和 MonoDroid)构建一个应用程序。我正在尝试编写一些代码,允许我将内容放入本地存储中。由于具有 Windows Phone 背景,我认为这也是 Xamarin 世界中推荐的方法。在 Windows Phone 上,我会执行以下操作:
IsolatedStorageSettings clientStorage = IsolatedStorageSettings.ApplicationSettings;
if (clientStorage != null)
{
if (clientStorage.Contains("myKey"))
clientStorage["myKey"] = value;
else
clientStorage.Add("myKey", value);
clientStorage.Save();
}
虽然 Xamarin 堆栈提供 System.IO.IsolatedStorage
,但它不提供 IsolatedStorageSettings
类。现在,我感到困惑,找不到例子。我的问题是,如何在 Mono 应用程序中的独立存储中添加值?
谢谢
最佳答案
IsolatedStorageSettings is not implemented in the mobile solutions 。看起来可以根据该帖子添加它,但它必须是自定义实现。
不过,一般来说,您还有其他一些选择。
关于c# - 在 Xamarin 中使用isolatedStorage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16426060/