C# 如何对列表使用二进制序列化<;对象>;

C# 如何对列表使用二进制序列化<;对象>;,c#,serialization,C#,Serialization,我有一个相同类的对象列表list channels=new list() 还有一个字符串保存文件名。我把这两个词都写进了词典: public class profile { public string Name { get; set; } public string CameraInfo { get; set; } // And many other properties describing the Profile Class } Dictionary DChanne

我有一个相同类的对象列表list channels=new list() 还有一个字符串保存文件名。我把这两个词都写进了词典:

public class profile
{
    public string Name { get; set; }
    public string CameraInfo { get; set; }
    // And many other properties describing the Profile Class
}
Dictionary DChannelList=newdictionary();

所以每次用户创建一个新的配置文件时,我都想把它附加到同一个文件中。并用文件名区分每个文件。建议使用哪种序列化?

Zip似乎是一种很好的格式。主要计划使用二进制序列化…你能帮我解决这个问题吗听起来你已经解决了。没有必要问这个问题。但我不知道如何使用它…我曾经处理过xml序列化,但这看起来很复杂…你能给我举个例子吗?不,你的问题不是这样问的。此外,我们不在这里编写代码。我们修复你的坏代码。所以,写一些错误的代码,问一个你想要答案的问题。
 Dictionary<string, List<profile>> DChannelList = new Dictionary<string, List<profile>>();