摘要: public class TrieTree { TrieNode _root = null; private TrieTree() { _root = new TrieNode(char.MaxValue,0); charCount = 0; } static TrieTree _instance = null; public static TrieTree GetInstance() { if (_instance =... 阅读全文
posted @ 2012-12-04 14:31 sky7034 阅读(457) 评论(0) 推荐(0) 编辑
摘要: Asp.net中IsPostBack这个属性相信大家一定经常用吧 判断是否为回发很多人说做项目时, pageload事件里 都要加上protectedvoidPage_Load(objectsender, EventArgs e){if(!IsPostBack){}}但是确不太理解原因 说加上这个肯定没错 可是 上篇的例子里 不就错了么? 所以 一定要理解原理~~为了把这个说清楚 这里不用asp.net页面 用html+handler 一般处理程序来讲清这个我先把代码贴出来html的<htmlxmlns="http://www.w3.org/1999/xhtml"&g 阅读全文
posted @ 2012-12-04 14:27 sky7034 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 因为我们的分页 支持通过下拉框选择页码后自动跳页 有点儿像webform 的autopostback 而我们又是get 提交版的 需要解决一个问题 选择后自动跳页 需要带上以前的查询条件 不能跳完页以后 查询条件消失了用一个隐藏的a 标签 这个a 标签生成的连接 保存了当前的查询条件等 他的页面数 显示成"*pageindex* 当我们选择下拉框跳页后 用选择的值 替换这个"*pageindex* 然后跳转到当前href 则解决了上述问题上代码 <text>跳转至</text> <select id="pageselect" 阅读全文
posted @ 2012-12-04 14:20 sky7034 阅读(369) 评论(0) 推荐(0) 编辑
摘要: mutexName="Local\\" +"AppName";只对创建它的会话有效,也就是说新开启一个远程链接时会再次启动 ConsoleApp实例。privatestaticvoidLocalMutex(){//是否第一次创建mutexboolnewMutexCreated=false;stringmutexName="Local\\"+"tenghoo";Mutexmutex=null;try{mutex=newMutex(false,mutexName,outnewMutexCreated);}catch(E 阅读全文
posted @ 2012-12-04 14:11 sky7034 阅读(200) 评论(0) 推荐(0) 编辑
摘要: privatestaticvoidGlobalMutex(){//是否第一次创建mutexboolnewMutexCreated=false;stringmutexName="Global\\"+"tenghoo";Mutexmutex=null;try{mutex=newMutex(false,mutexName,outnewMutexCreated);}catch(Exceptionex){Console.Write(ex.Message);System.Threading.Thread.Sleep(3000);Environment.Exit(1) 阅读全文
posted @ 2012-12-04 14:07 sky7034 阅读(183) 评论(0) 推荐(0) 编辑
摘要: is_*is_null:检测变量是否为 NULLis_array:检测变量是否是数组is_bool:检测变量是否是布尔型is_double,is_float,is_real:检测变量是否是浮点is_int,is_integer,is_long:检测变量是否是整数is_numeric:检测变量是否为数字或数字字符串is_object:检测变量是否是一个对象is_resource:检测变量是否为资源类型is_scalar:检测变量是否是一个标量,标量变量是指那些包含了 integer、float、string 或 boolean的变量,而 array、object 和 resource 则不是标量 阅读全文
posted @ 2012-12-04 14:06 sky7034 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 2.0中的定义:publicinterfaceIEnumerable<T>:IEnumerable{IEnumerator<T>GetEnumerator();}4.0中的定义:publicinterfaceIEnumerable<outT>:IEnumerable{IEnumerator<T>GetEnumerator();}可以看到4.0中增加了对协变的支持。可以在两个版本试下, 下面的语句在2.0下会报错。 List<SubClass>subarr=newList<SubClass>(); IEnumerable&l 阅读全文
posted @ 2012-12-04 14:03 sky7034 阅读(190) 评论(0) 推荐(0) 编辑
蘑菇街女装 货运专家