Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/323.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 隔离存储设置的多个实例?_C#_Windows Phone 8_Isolatedstorage_Application Settings_Isolatedstoragefile - Fatal编程技术网

C# 隔离存储设置的多个实例?

C# 隔离存储设置的多个实例?,c#,windows-phone-8,isolatedstorage,application-settings,isolatedstoragefile,C#,Windows Phone 8,Isolatedstorage,Application Settings,Isolatedstoragefile,我正在寻找使用C#在Win Phone 8中存储数据的方法 首先,是否可以创建多个IsolatedStorageSettings实例 例如,下面的代码将构成两组独立的设置: IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; IsolatedStorageSettings settings2 = IsolatedStorageSettings.ApplicationSettings; 其

我正在寻找使用C#在Win Phone 8中存储数据的方法

首先,是否可以创建多个IsolatedStorageSettings实例

例如,下面的代码将构成两组独立的设置:

IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
IsolatedStorageSettings settings2 = IsolatedStorageSettings.ApplicationSettings;
其次,我查看了隔离的存储文件,但在下面的代码中出现了错误。可能是我正在使用的示例跳过了一些步骤

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

  • “System.IO.IsolatedStorage.IsolatedStorage文件”不包含 “GetStore”的定义
  • 当前上下文中不存在名称“IsolatedStorageScope”
  • 当前上下文中不存在名称“IsolatedStorageScope”

查看MSDN上的这篇文章,因为它清楚地说明了

获取包含应用程序的IsolatedStorageFile的内容的IsolatedStorageSettings实例,其作用域在应用程序级别,或者创建IsolatedStorageSettings的新实例(如果不存在)

因此,不可能创建多个
隔离存储设置的实例

对于
IsolatedStorageFiles
,msdn页面上有一个非常全面的示例来处理它