C#深拷贝通用方法(引用类型的拷贝)
/// <summary>
/// 深度COPY
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="obj"></param>
/// <returns></returns>
public static T DeepClone<T>(T obj)
{
T objResult;
using (MemoryStream ms = new MemoryStream())
{
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(ms, obj);
ms.Position = ;
objResult = (T)bf.Deserialize(ms);
} return objResult;
}