1. public object Clone()  
  2.        {  
  3.            BinaryFormatter Formatter = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.Clone));  
  4.            MemoryStream stream = new MemoryStream();  
  5.            Formatter.Serialize(stream, this);  
  6.            stream.Position = 0;  
  7.            object clonedObj = Formatter.Deserialize(stream);  
  8.            stream.Close();  
  9.            return clonedObj;   
  10.        } 
posted on 2012-07-10 09:10  fenix  阅读(169)  评论(0编辑  收藏  举报