2012-10-10 99 views
0

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

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

回答

0

你不应该在您的文章使用

IsolatedStorageSettings.ApplicationSettings["endResponse"] 

而不是这个?

IsolatedStorageSettings.ApplicationSettings[endResponse] 
+0

我做了多少愚蠢的错误,感谢信息,我正在检查它 – Rakesh