7,765
社区成员
发帖
与我相关
我的任务
分享
public string Serialize(TechSummaryInfo summary)
{
BinaryFormatter formate = new BinaryFormatter();
using (MemoryStream stream = new MemoryStream())
{
formate.Serialize(stream, summary);
byte[] bytes = new byte[stream.Length];
stream.Read(bytes, 0, bytes.Length);
return Encoding.UTF8.GetString(bytes);
}
}
Regex reg = new Regex(patten1, RegexOptions.Multiline);
public string Serialize(TechSummaryInfo summary)
{
BinaryFormatter formate = new BinaryFormatter();
using (MemoryStream stream = new MemoryStream())
{
formate.Serialize(stream, summary);
byte[] bytes = new byte[stream.Length];
stream.Read(bytes, 0, bytes.Length);
return Encoding.UTF8.GetString(bytes);
}
}