摘要: 工厂方法模式(Factory Method)——.NET设计模式系列之五转载概述在软件系统中,经常面临着“某个对象”的创建工作,由于需求的变化,这个对象的具体实现经常面临着剧烈的变化,但是它却拥有比较稳定的接口。如何应对这种变化?提供一种封装机制来隔离出“这个易变对象”的变化,从而保持系统中“其它依赖该对象的对象”不随着需求的改变而改变?这就是要说的Factory Method模式了。意图定义一个... 阅读全文
posted @ 2007-03-13 23:34 sunney 阅读(7585) 评论(4) 推荐(2)
摘要: static bool IsNumeric(string str) { System.Text.RegularExpressions.Regex reg1 = new System.Text.RegularExpressions.Regex(@"^\d+[.]?\d*$"); return reg1.IsMatch(str); }支持负数static bool IsNumeric(string s... 阅读全文
posted @ 2007-03-13 10:45 sunney 阅读(502) 评论(0) 推荐(0)
摘要: 1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int 日=curre... 阅读全文
posted @ 2007-03-13 10:44 sunney 阅读(8710) 评论(1) 推荐(1)