2012-10-10 98 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