public static T DeepClone<T>(this T st)
{
BinaryFormatter bf = new BinaryFormatter();
MemoryStream ms = new MemoryStream();
bf.Serialize(ms, st);
ms.Position = 0;
return (T)bf.Deserialize(ms);
}
C# 深拷贝
最新推荐文章于 2024-06-12 16:01:05 发布