上一页 1 ··· 5 6 7 8 9 10 11 12 下一页
摘要: Return ValueType:System.Threading..::.RegisteredWaitHandleTheRegisteredWaitHandlethat encapsulates the native handle.相信看了这些之后大家还是一头雾水,这个方法的做用是向线程池添加一个可以定时执行的方法,第四个参数millisecondsTimeOutInterval就是用来设置间隔执行的时间,但是这里第五个参数executeOnlyOnce会对第四个参数起作用,当它为true时,表示任务仅会执行一次,就是说它不会,像Timer一样,每隔一定时间执行一次,这个功能的话用Timer 阅读全文
posted @ 2012-01-18 15:32 superstar 阅读(456) 评论(0) 推荐(0)
摘要: 工厂方法模式比喻请女生去麦当劳吃汉堡,不同的女生有不同的口味,要每个都记住是一件烦人的事情,我一般采用Factory Method-工厂方法模式,带着女孩到服务员那儿,说“要一个汉堡”,具体要什么样的汉堡呢,让女生直接跟服务员说就行了。工厂方法模式意图工厂方法模式(Factory Method),定义一个用于创建对象的接口,让子类决定实例化哪一个类。工厂方法使一个类的实例化延迟到其子类。工厂方法模式类图工厂方法模式实现 /// <summary> /// 工厂方法模式中,提供不同的女孩不同的口味的汉堡,相当于我的职责 /// </summary> interface I 阅读全文
posted @ 2011-12-28 18:19 superstar 阅读(265) 评论(0) 推荐(0)
摘要: 猫叫,老鼠跑,主人醒,主人叫,老鼠躲进背窝,猫也躲class Program { static void Main(string[] args) { 主人 主人 = new 主人(); 猫 猫 = new 猫(); 老鼠 老鼠 = new 老鼠(); 猫.事件_叫 += new 猫.委托_叫(老鼠.跑); 猫.事件_叫 += new 猫.委托_叫(主人.主人醒); 主人.事件_叫 += new 主人.主人叫( 猫.躲进背窝); 主人.事件_叫 += new 主人.主人叫(老鼠.躲进背窝); 猫.猫叫(); Console.Read(); } } public class 猫 { publ... 阅读全文
posted @ 2011-12-19 22:29 superstar 阅读(561) 评论(2) 推荐(0)
摘要: english:The Visual Studio HTM Editor Package ({1B437D20-F8FE-11D2-A6AE-00104BCC7269}) did not load because of previous errors. For assistance, contact the package vendor. To attempt to load this package again, type 'devenv /resetskippkgs' at the command prompt.未能正确加载包"visla Studio HTM Editor 阅读全文
posted @ 2011-07-07 11:23 superstar 阅读(936) 评论(1) 推荐(0)
摘要: 序列化是指一个对象的实例可以被保存,保存成一个二进制串,当然,一旦被保存成二进制串,那么也可以保存成文本串了。比如,一个计数器,数值为2,我们可以用字符串“2”表示。如果有个对象,叫做connter,当前值为2,那么可以序列化成“2”,反向的,也可以从“2”得到值为2的计数器实例。这样,关机时序列化它,开机时反序列化它,每次开机都是延续的。不会都是从头开始。序列化概念的提出和实现,可以使我们的应用程序的设置信息保存和读取更加方便。序列化有很多好处,比如,在一台机器上产生一个实例,初始化完毕,然后可以序列化,通过网络传送到另一台机器,然后反序列化,得到对象实例,之后再执行某些业务逻辑,得到结果, 阅读全文
posted @ 2011-05-30 21:11 superstar 阅读(557) 评论(0) 推荐(0)
摘要: c# HttpWebRequest与HttpWebResponse 绝技1.第一招,根据URL地址获取网页信息 先来看一下代码get方法publicstaticstringGetUrltoHtml(stringUrl,stringtype){try{System.Net.WebRequestwReq=System.Net.WebRequest.Create(Url);//Gettheresponseinstance.System.Net.WebResponsewResp=wReq.GetResponse();System.IO.StreamrespStream=wResp.GetRespon. 阅读全文
posted @ 2011-05-26 14:14 superstar 阅读(938) 评论(0) 推荐(0)
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Collections;namespaceSystemDAO{///<summary>///数据库的通用访问代码苏飞修改//////此类为抽象类,/ 阅读全文
posted @ 2011-05-26 14:08 superstar 阅读(329) 评论(0) 推荐(0)
摘要: using System;using System.Xml;using System.Text;using System.Net;using System.IO;using System.Collections;using System.Text.RegularExpressions;public class App{public static void Main(){string strCode;ArrayList alLinks;Console.Write("请输入一个网页地址:");string strURL = Console.ReadLine();if(strUR 阅读全文
posted @ 2011-04-10 13:43 superstar 阅读(307) 评论(0) 推荐(0)
摘要: 编程控制IIS实际上很简单,和ASP一样,.Net中需要使用ADSI来操作IIS,但是此时我们不再需要GetObject,因为.Net为我们提供了更加强大功能的新东西。System.DirectoryServices命名空间中包括了些强大的--DirectoryEntry,DirectoryEntries,它们为我们提供了访问活动目录的强大功能,在这些类允许我们操作IIS、LDAP、NDS以及WinNT。不过我们此处只谈IIS的控制,一般来说,我们操作IIS一般都是对虚拟目录的操作,因此我将此列为主要的内容来讲。 首先我们要搞清楚IIS的层次结构的问题,下面是我从国外找来的一张图,很好的解释了 阅读全文
posted @ 2011-03-29 20:52 superstar 阅读(1571) 评论(0) 推荐(0)
摘要: System.Globalization.NumberFormatInfo provider = new System.Globalization.NumberFormatInfo();provider.NumberDecimalDigits =intDecLength; //要设定的小数位数double strCashAmt=Convert.ToDouble(this.txtCashAmt.Text); //先把控件內的值转成doublethis.txtCashAmt.Text = strCashAmt.ToString("N",provider); //再利用ToStr 阅读全文
posted @ 2011-03-21 11:32 superstar 阅读(1201) 评论(0) 推荐(1)
上一页 1 ··· 5 6 7 8 9 10 11 12 下一页