像这些 cocoa 方法:
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile: path]
[dict writeToFile: someOtherPath atomically: YES];
NSArray *array = [NSArray arrayWithContentsOfFile: path];
[array writeToFile: someOtherPath atomically: YES];
等等。理想情况下,文件格式应该是我可以手动创建和编辑的格式。
编辑:这是针对 Windows Phone 7 的。
编辑:感谢您的回答。尽管浏览了您的一些链接。 . . XMLSerializer 不处理字典?!?!?
最佳答案
你也可以看看这篇关于 binary serialization 的帖子在 Windows Phone 7 上。是否要进行二进制或 xml 序列化将取决于您的需要。
您可能也对此感兴趣 discussion of binary vs xml serialization .
关于c# - Silverlight C# 是否有将集合转换为文件以及相反的标准方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5838695/