上一页 1 ··· 9 10 11 12 13 14 下一页
摘要: function GetEle(obj, IsPre, nodeName) { if (IsPre) { if (obj.previousSibling.nodeName.toLowerCase() == nodeName.toLowerCase()) { return obj.previousSibling; } return GetEle(obj.previousSibling, IsPre, nodeName); } else { if (obj.nextSibling.nodeName.toLowerCase() == nodeName.toLowerCase()) { return 阅读全文
posted @ 2010-08-06 16:53 再快一点 阅读(505) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;namespace Test{ delegate void MyDelegate(); delegate MyClosure Closure(); class Program { static void Main(string[] args) { Closure clo = new Closure(Fun); MyClosure mm = clo(); mm.Show(); mm.Add(); mm. 阅读全文
posted @ 2010-08-02 14:55 再快一点 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 第一种:.Net 3.5 代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 闭包{ class Program { static void Main(string[] args) { ListAction arr = new ListAction(); for (int i = 0; i 3; i++) { arr.Add(()={Console.WriteLine(i);}); } foreach (var item in arr) { 阅读全文
posted @ 2010-08-01 14:39 再快一点 阅读(417) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Collections;class Program{ static void Main(string[] args) { //第一个例子 //int counter = 0; //IEnumerableint values = Utilities.Generate(10, () = counter++); //Console.WriteLine("Current Counter: {0}", counter); //foreach (int num in values) 阅读全文
posted @ 2010-07-29 09:40 再快一点 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 转自:http://hi.baidu.com/oohacker/blog/item/6004e6fb712feb254e4aea24.html有关C#锁语句的讨论网上说得很多, 但绝大多数只说了了怎么用, 对于lock的注意事项却很少, 尤其是关于lock(this), lock(typeof(ClassName))以及lock("thisLock")的讨论更是凤毛麟角, 就连MSDN中对于前面提及的三种lock可能导致的问题也是一笔带过(http://msdn.microsoft.com/zh-cn/worldwide/c5kehkcz.aspx)。百度和Google了许久,终于收集到 阅读全文
posted @ 2010-07-28 16:04 再快一点 阅读(987) 评论(0) 推荐(2) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Text.RegularExpressions;namespace 正则积累{ class Program { static void Main(string[] args) { //Fun1(); //Fun2(); //Fun3(); //Fun4(); //Fun5(); //Fun6(); //Fun7(); Fun8(); //Regex reg = new Regex("^a.*b$"); // 阅读全文
posted @ 2010-07-24 16:40 再快一点 阅读(561) 评论(0) 推荐(1) 编辑
摘要: 转载自:http://blog.chinaunix.net/u3/99423/showart_2100968.htmlscanf函数我曾经在 这个函数上犯过不少错误,也看到别人犯过的错误,记下来,提醒自己不要重蹈覆辙了。如果对你有用,那就更好了:)如果你发现文章中有错误,欢迎你不吝赐 教。希望和大家一起学习!(我的邮箱:moongbingbing@gmail.comblog: http://blog.csdn.net/wayne92 温铭 )有关详细的scanf函数解释,大家可以去看看《C程序设计语言》(K&C)和《C语言大全》(后面我把其中scanf的部 分贴了出来)。 曾经错的几个地方: 阅读全文
posted @ 2010-07-05 15:33 再快一点 阅读(2751) 评论(0) 推荐(0) 编辑
摘要: 1.判断某个字符串里是否不包含abc var str="abcad"; var reg=/^((?!abc).)*$/; alert(str.search(reg)); 阅读全文
posted @ 2010-07-05 14:01 再快一点 阅读(283) 评论(0) 推荐(1) 编辑
摘要: htmlheadtitle新羿集团/title/headscript type='text/javascript' function People() { this.age=9; //obj是对象直接量,在对象直接量中使用this关键字,this引用的不是调用对象,而是实例化的对象,和new Fun()的函数Fun里面this引用的需要实例化的对象一样 var obj={SetAge:function(num){this.age=num;},GetAge:function(){return this.age;}}; obj.SetAge(99); alert(ob 阅读全文
posted @ 2010-06-27 23:59 再快一点 阅读(525) 评论(0) 推荐(0) 编辑
摘要: 此文转自:http://blog.csdn.net/xkyle/archive/2008/11/25/3368597.aspx//没有返回值functionTest0(){this.name='test0';}vartest0=newTest0;//debugger;alert(test0);//输出[Object]alert(test0.name);//输出test0//return一个字符串对象functionTest(){this.name='test';returnnewString('123');//返回字符 串对象}vartest=newTest();alert(test);//输 阅读全文
posted @ 2010-06-27 23:46 再快一点 阅读(1342) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 下一页