public static T DeepCopyByBinStream<T>(T obj)
{
object ret;
using (MemoryStream ms = new MemoryStream())
{
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(ms, obj);
ms.Seek(0, SeekOrigin.Begin);
ret= bf.Deserialize(ms);
}
return (T)ret;
}
posted on
2018-07-05 10:32WYVE
阅读(133)
评论(0)
编辑收藏举报