3
我在我的Windows Phone 7项目中使用IsolatedStorageSettings类作为键值存储区,以便在我的应用程序中记住用户首选项和登录凭据。Windows Phone 7,IsolatedStorageSettings“删除()”不起作用,一个错误?
问题是,当我用键调用Remove(string)
方法,然后使用Save()
方法来保存更改。 Remove()
方法返回true
,这意味着值被删除。但是当我下次尝试获取价值时,我发现它仍然存在并且未被删除。
下面是我用为删除代码:
if (isolatedStore.Contains(key))
{
isolatedStore[key] = null;
}
bool del = isolatedStore.Remove(key);
isolatedStore.Save();
以下是我得到isolatedStorage
例如:
private IsolatedStorageSettings isolatedStore =
IsolatedStorageSettings.ApplicationSettings;
如果你认为这个问题是什么?
问题是在你的应用程序中的某处** else **。 –
看看这可以帮助你:http://stackoverflow.com/questions/3145803/windows-phone-7-config-appsettings –
你是针对测试芒果或旧版本?尝试通过在调用Remove时删除空值的作用,删除键和它的值都将被删除 – Waleed