2013年12月20日

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 阅读(197) 评论(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 阅读(106) 评论(0) 推荐(0)

2013年12月13日

线程,任务,同步之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 阅读(133) 评论(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 阅读(168) 评论(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 阅读(199) 评论(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 阅读(365) 评论(0) 推荐(0)

2013年12月12日

反射基础一

摘要: /*反射*/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 阅读(141) 评论(0) 推荐(0)

2013年12月11日

自定义特性

摘要: /*自定义特性*/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 阅读(147) 评论(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 阅读(142) 评论(0) 推荐(0)

2013年12月7日

集(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 阅读(252) 评论(0) 推荐(0)

导航