C# 存储字典<;TKey,TValue>;隔离储存
我正在访问服务器并获取一些数据,正在解析这些数据并将其存储在C# 存储字典<;TKey,TValue>;隔离储存,c#,windows-phone-7,dictionary,isolatedstorage,C#,Windows Phone 7,Dictionary,Isolatedstorage,我正在访问服务器并获取一些数据,正在解析这些数据并将其存储在字典中 我将此词典列表存储在独立存储中。现在的问题是,每当我尝试检索字典(在第二次运行中)我在第一次运行中存储的内容时,bean中每个键的值都会变为null。我不知道我存储字典的方式是否错误 代码示例: CacheManager.getInstance().PersistData(CacheManager.SERVICE_TABLE, dictionaryList); public void PersistData(stri
字典中
我将此词典
列表存储在独立存储中。现在的问题是,每当我尝试检索字典(在第二次运行中)我在第一次运行中存储的内容时,bean中每个键的值都会变为null。我不知道我存储字典的方式是否错误
代码示例:
CacheManager.getInstance().PersistData(CacheManager.SERVICE_TABLE,
dictionaryList);
public void PersistData(string storageName, object dict)
{
try
{
PersistDataStore.Add(storageName, dict);
PersistDataStore.Save();
}
catch (Exception ex)
{
}
}
我找到了问题的解决方案,字典dict的成员必须序列化。i、 e
using System.Runtime.Serialization;
[DataContact]
public class classname()
{
[datamember]
public int propertyname;
}
@Apoorva我们需要知道缓存使用的是什么框架。