标签:
// ProtoBuf序列化
using(var file = System.IO.File.Create("Person.bin"))
{
ProtoBuf.Serializer.Serialize(file, person);
}
// ProtoBuf反序列化
Person binPerson = null;
using(var file = System.IO.File.OpenRead("Person.bin"))
{
binPerson = ProtoBuf.Serializer.Deserialize<Person>(file);
}
标签:
原文地址:http://www.cnblogs.com/zeroone/p/4479803.html