簡體   English   中英

IsolatedStorageSettings的多個實例?

[英]More than one instance of IsolatedStorageSettings?

我正在尋找使用C#在Win Phone 8中存儲數據的方法。

首先,是否可以創建多個IsolatedStorageSettings實例?

例如,下面的代碼將分為兩組不同的設置:

IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
IsolatedStorageSettings settings2 = IsolatedStorageSettings.ApplicationSettings;

其次,我查看了IsolatedStorageFiles但是在下面的代碼中出現了錯誤。 可能是我正在使用的示例已跳過一些步驟。

IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);

錯誤:

  • 'System.IO.IsolatedStorage.IsolatedStorageFile'不包含'GetStore'的定義
  • “IsolatedStorageScope”這個名稱在當前上下文中不存在
  • “IsolatedStorageScope”這個名稱在當前上下文中不存在

查看有關MSDN IsolatedStorageSettings.ApplicationSettings屬性的文章,因為它明確說明

獲取IsolatedStorageSettings的實例,其中包含應用程序級別的IsolatedStorageFile的內容,或者如果不存在,則創建IsolatedStorageSettings的新實例。

因此無法創建多個IsolatedStorageSettings實例。

對於IsolatedStorageFiles ,在msdn頁面上有一個非常全面的例子來處理它。 IsolatedStorageFile類

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM