12 2013 档案

asp.net找控件
摘要:protected void Page_Load(object sender, EventArgs e) { /* 找到所有控件 Response.Write("Page_Load"); string str = ""; foreach (Control item in Page.Controls) { str+=item.GetType() + " " + item.ID + ""; } Res... 阅读全文

posted @ 2013-12-20 17:02 wp456 阅读(200) 评论(0) 推荐(0)

asp.net页面生命周期
摘要:简单的列举几个方法,还有很多方法private void Page_Init(object sender, System.EventArgs e) { Response.Write("Page_Init"); } protected void Page_Load(object sender, EventArgs e) { Response.Write("Page_Load"); } private void Page_PreRender(object sender, ... 阅读全文

posted @ 2013-12-20 15:05 wp456 阅读(107) 评论(0) 推荐(0)

线程,任务,同步之Thread(二)
摘要:/*线程,任务,同步之Thread(二)*/using System;using System.Threading;using System.Diagnostics;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { /* //Thread t1 = new Thread(ThreadMethod); Thread t1 = new Thread(()=>{Console.WriteLine("2");});//使用Lambda表... 阅读全文

posted @ 2013-12-13 16:55 wp456 阅读(136) 评论(0) 推荐(0)

线程,任务,同步之Thread
摘要:/*线程,任务,同步之Thread*/using System;using System.Threading;using System.Diagnostics;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { //Thread t1 = new Thread(ThreadMethod); Thread t1 = new Thread(()=>{Console.WriteLine("2");});//使用Lambda表达式 t1.... 阅读全文

posted @ 2013-12-13 15:26 wp456 阅读(169) 评论(0) 推荐(0)

线程,任务,同步之异步回调
摘要:/*线程,任务,同步之异步回调*/using System;using System.Threading;using System.Diagnostics;namespace Frank{ public class Test { public delegate int TakesAWhileDelegate(int data,int ms); //程序入口 public static void Main(string[] args) { TakesAWhileDelegate dl = new TakesAWhileDelegate(TakesAWhi... 阅读全文

posted @ 2013-12-13 14:45 wp456 阅读(202) 评论(0) 推荐(0)

线程,任务,同步之异步执行和等待线程
摘要:/*线程,任务,同步之异步执行和等待线程*/using System;using System.Threading;namespace Frank{ public class Test { public delegate int TakesAWhileDelegate(int data,int ms); //程序入口 public static void Main(string[] args) { TakesAWhileDelegate dl = new TakesAWhileDelegate(TakesAWhile); IAsyncResult ... 阅读全文

posted @ 2013-12-13 14:21 wp456 阅读(368) 评论(0) 推荐(0)

反射基础一
摘要:/*反射*/using System;using System.Reflection;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { Type intType = typeof(int); System.Console.WriteLine(intType.IsAbstract); System.Console.WriteLine(intType.IsClass); System.Console.WriteLine(intT... 阅读全文

posted @ 2013-12-12 11:02 wp456 阅读(144) 评论(0) 推荐(0)

自定义特性
摘要:/*自定义特性*/using System;namespace Frank{ public class Test { [FileName("Name")] public string Name {get;set;} //程序入口 public static void Main(string[] args) { Test t = new Test(); t.Name="1"; } } //AllowMultiple 表示一个地方是否可以重复使用属性 //Inherited 表示是否可以应用到派生类 //AttributeTargets 是一个枚举... 阅读全文

posted @ 2013-12-11 16:17 wp456 阅读(148) 评论(0) 推荐(0)

内存管理与指针
摘要:/*内存管理与指针每隔一段时间GC会自动执行清理,也可以程序调用。清理的时候会执行终结器,然后清理,也可以调用超级清理告诉GC不用调用终结器。*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { unsafe { int x = 10; int* pX,pY; pX = & x;//取址符号 pY = pX; *pY = 20;//反向取... 阅读全文

posted @ 2013-12-11 09:06 wp456 阅读(143) 评论(0) 推荐(0)

集(Set)
摘要:/*集(Set).Net4包含两个HashSet 和 SortedSetHashSet包含不重复元素的无序列表,SortedSet包含不重复元素的有序集合*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { HashSet hs1 = new HashSet(); hs1.Add("wuhan"); System.Console.WriteLine(hs1.Add... 阅读全文

posted @ 2013-12-07 10:19 wp456 阅读(256) 评论(0) 推荐(0)

有序字典
摘要:/*有序字典SortedDictionary类的使用,它是一个二叉搜索树它比SortedList的元素插入和删除速度比较快。SortedList的内存比它占用的要少,在已排序的数据填充集合时SortedList要快。*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { SortedDictionary sd = new SortedDictionary(); sd.A... 阅读全文

posted @ 2013-12-06 15:21 wp456 阅读(172) 评论(0) 推荐(0)

Lookup类的使用
摘要:/*Lookup类的使用 一键多值*/using System.Linq;using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { List list = new List(); list.Add(new Racer("jack","wuhan")); list.Add(new Racer("tom","wuhan")); list.Add 阅读全文

posted @ 2013-12-06 14:43 wp456 阅读(261) 评论(0) 推荐(0)

字典Dictionary
摘要:/*字典Dictionary (映射或者散列表)键值对的,如果把一个自定义类型作为字典的键,那么必须重写GetHashCode和Equals方法string类就实现了,一般用string类型的最为键*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { Dictionary d = new Dictionary(); d.Add("1","a"); d.Add(" 阅读全文

posted @ 2013-12-05 14:58 wp456 阅读(131) 评论(0) 推荐(0)

有序列表
摘要:/*有序列表键值对的表示一个键只能有一个值,如果需要多个值,使用Lookup类*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { SortedList books = new SortedList(); books.Add("1","2sad"); books.Add("2","sadsad"); books["3&qu 阅读全文

posted @ 2013-12-05 11:49 wp456 阅读(148) 评论(0) 推荐(0)

双向链表
摘要:/*双向链表放入元素速度十分的快。*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { LinkedListNode ln = new LinkedListNode("c"); LinkedList ll = new LinkedList(); ll.AddLast("a"); ll.AddLast("b"); ll.AddLast(ln); for. 阅读全文

posted @ 2013-12-05 11:38 wp456 阅读(103) 评论(0) 推荐(0)

栈,后进先出
摘要:/*栈,后进先出*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { Stack stack = new Stack(); stack.Push(1); stack.Push(5); stack.Push(6); stack.Push(7); foreach (int item in stack) { System.Console.Write... 阅读全文

posted @ 2013-12-05 10:42 wp456 阅读(322) 评论(0) 推荐(0)

队列的使用 先进先出的原则
摘要:/*队列的使用 先进先出的原则*/using System.Threading;using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { DocumentManager dm = new DocumentManager(); ProcessDocuments.Start(dm); for(int i = 0;i documentQueue = new Queue(); ... 阅读全文

posted @ 2013-12-05 10:30 wp456 阅读(543) 评论(0) 推荐(0)

导航