文章分类 - c#
摘要:1 using Landlords; 2 using System; 3 using System.Collections.Generic; 4 using System.Linq; 5 using System.Text; 6 using System.Threading.Tasks...
阅读全文
摘要:1 // A 2 // B C 3 // D E F 4 //G H 5 //先序:A-B-D-G-H-C-E-F 6 //中序:B-G-D-H-A-E-C-F 7 //后序:G-H-D-B-E-F-C-A 8 //层级:A...
阅读全文
摘要:C#List用法所属命名空间:System.Collections.GenericpublicclassList:IList,ICollection,IEnumerable,IList,ICollection,IEnumerableList类是ArrayList类的泛型等效类。该类使用大小可按需动态增加的数组实现IList泛型接口。泛型的好处:它为使用c#语言编写面向对象程序增加了极大的效力和灵活性。不会强行对值类型进行装箱和拆箱,或对引用类型进行向下强制类型转换,所以性能得到提高。性能注意事项:在决定使用IList还是使用ArrayList类(两者具有类似的功能)时,记住IList类在大多数
阅读全文
摘要:1 Rectangle rect = new Rectangle(0, 0, 100, 100);//X,Y,W,H2 Point testPoint1 = new Point(50, 60);3 rect.Contains(testPoint1);//在矩形里面,返回true4 5 Point testPoint2 = new Point(110, 20);6 rect.Contains(testPoint2);//不在矩形里面,返回false需要加 using System.Drawing;
阅读全文
摘要:1 Hashtable hashtable = new Hashtable(); 2 Random rm = new Random(); 3 int RmNum = 5; //随机数个数 4 for (int i = 0; hashtable.Count < RmNum; i++) 5 { 6 int nValue = rm.Next(-5,5);//随机数范围 7 if (!hashtable.ContainsValue(nVal...
阅读全文

浙公网安备 33010602011771号