![](/img/trans.png)
[英]How to make IsolatedStorageSettings persist even after the device is turned off?
[英]How to make IsolatedStorageSettings persist even after the device/emulator is turned off?
我已經讀過在wp8中存儲在Isolated Storage中的數據是永久性的。但我對“永久”一詞感到有點困惑。 我沒有wp8設備所以我無法在真實設備上查看。 我嘗試了模擬器,一切正常,直到我關閉我的模擬器。 我想知道當應用程序關閉或設備關閉時,真實設備上是否存在同樣的問題。
我的代碼用於保存電子郵件和密碼..
private IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings;
try
{
appSettings.Add("email", this.txt_email.Text);
appSettings.Add("password", this.txt_password.Text);
appSettings.Save();
}
catch (ArgumentException ex)
{
MessageBox.Show("ERROR"+ex.Message);
}
return register;
任何人都可以幫我這樣做嗎???
是的,你讀的是正確的。 “存儲在WP8設備中的隔離存儲中的數據是永久性的”。 只要您的應用程序在設備中,“永久”就可以了。 只有當用戶從設備上卸載應用程序時,數據才會被刪除。 即使應用程序已關閉或即使手機重新啟動,數據仍會存在。
它與仿真器不同。 模擬器關閉后,所有數據都將丟失。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.