【发布时间】:2013-03-07 07:45:13
【问题描述】:
我得到了一个将对象序列化为文件的 Protobuf-net 源代码。
var person = new Person {
Id = 12345, Name = "Fred",
Address = new Address {
Line1 = "Flat 1",
Line2 = "The Meadows"
}
};
using (var file = File.Create("person.bin")) {
ProtoBuf.Serializer.Serialize(file, person);
}
但假设我有两个要序列化为单个文件的 Person 实例。我该怎么做?
【问题讨论】:
-
我在stackoverflow.com/questions/817641/… 中得到了解决方案,感谢 Agin to Marc Gravell
标签: c# file serialization protobuf-net