luckapple2

2011年6月2日

c#中常会涉及到一些类,List的深度拷贝。

摘要: public object Clone(object ldc) { BinaryFormatter Formatter = new BinaryFormatter(); MemoryStream stream = new MemoryStream(); Formatter.Serialize(stream, ldc); stream.Position = 0; object clonedObj = Formatter.Deserialize(stream); stream.Close(); return clonedObj; } 阅读全文

posted @ 2011-06-02 11:07 luckapple2 阅读(1727) 评论(0) 推荐(1) 编辑

导航