保存到隔离存储设置的问题

时间:2012-10-10 13:38:11

标签: windows-phone-7

当我将数据(String)保存到隔离数据存储时,它正在成功保存数据,但是从数据存储中检索数据时,我获取了上一页的数据。 我在App.xaml.cs中有String变量,我从页面分配值,在停用应用程序,最后一页保存的信息,当我恢复它时,我应该得到我保存的字符串,但这是我的地方我得到这个问题,我得到一些时间前一页或之前的页面值,如果我删除应用程序并成功构建应用程序它成功运行,但当你删除应用程序和继续进行构建和构建过程时,我得到这个问题

if (IsolatedStorageSettings.ApplicationSettings.Contains("endResponse"))
      {
          IsolatedStorageSettings.ApplicationSettings[endResponse] = App.endResponse;
      }
      else
      {
          settings.Add("endResponse", App.endResponse);
      }

我正在使用

进行检索
  if (IsolatedStorageSettings.ApplicationSettings.Contains("endResponse"))
             {
                 IsolatedStorageSettings.ApplicationSettings.TryGetValue<String>("endResponse", out App.endResponse);

             }
             Debug.WriteLine("App.end Response in IsolatedStorage while activation>>>" + App.endResponse);

从模拟器中删除应用程序并在测试应用程序时,它运行良好,除此之外我总是得不到确切的值。

我附上问题的截图,请检查并告诉我,如果我错过任何内容。

enter image description here

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

你不应该使用

IsolatedStorageSettings.ApplicationSettings["endResponse"]

而不是你的帖子?

IsolatedStorageSettings.ApplicationSettings[endResponse]
相关问题