10 2013 档案

摘要:代理模式笔记 阅读全文
posted @ 2013-10-28 00:57 偏执的放纵 阅读(258) 评论(0) 推荐(0)
摘要:浅拷贝:里面的对象指向的对象一样。深拷贝:里面的对象指向的对象不一样。浅拷贝可以在类中添加一个方法 public MyClass Qiankaobei(){ return (MyClass) this.MemberwiseClone();}深拷贝public MyClass ShenKaoBei(){ BinaryFormater bf=new BinaryFormatter(); using(MemoryStream ms=new MemoryStream()){ bf.Serialize(ms,this); ms.Position=0; MyClass mcobj=... 阅读全文
posted @ 2013-10-14 02:13 偏执的放纵 阅读(159) 评论(0) 推荐(0)
摘要:XML主要的功能是用来存储数据的。好处,用文本格式进行保存。不需要安装其他软件打开。XML和HTML的区别:1.有且只能有一个根元素。2.XML中的元素必须关闭。3.XML中元素的属性值必须用引号。4.XML大小写敏感。XML读取1.获取xmlXDocument xdoc=XDocument.Load("路径");2.获取根元素XElement root=xdoc.Root;3.获取元素.IEnumerableXElements=root.Elements();4.获取元素IAttribute Attributeitem-XElementitem.Attributes(); 阅读全文
posted @ 2013-10-13 20:24 偏执的放纵 阅读(184) 评论(0) 推荐(0)
摘要:反射反射:就是动态获取程序集中的元数据来操作类型的。 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Reflection; 6 7 namespace 反射的应用获取dll 8 { 9 class Program10 {11 static void Main(string[] args)12 {13 #region 1加载指定的程序集,并获取该程序集中... 阅读全文
posted @ 2013-10-11 02:01 偏执的放纵 阅读(187) 评论(0) 推荐(0)