上一页 1 ··· 67 68 69 70 71 72 73 74 75 ··· 215 下一页
摘要: //添加 TIdIPWatch 控件: IdIPWatch1 procedure TForm1.Button1Click(Sender: TObject); var ip: string; begin ip := IdIPWatch1.LocalIP; ShowMessage(ip); end; 阅读全文
posted @ 2009-03-08 22:45 万一 阅读(3060) 评论(5) 推荐(0) 编辑
摘要: uses WinInet; procedure TForm1.Button1Click(Sender: TObject); begin if InternetGetConnectedState(nil, 0) then ShowMessage('已连接'); end; 阅读全文
posted @ 2009-03-08 22:39 万一 阅读(8713) 评论(17) 推荐(0) 编辑
摘要: 最近经常需要查看 UniCode 全表(0000-FFFF), 用 js 写了一个. 阅读全文
posted @ 2009-03-06 22:04 万一 阅读(22682) 评论(9) 推荐(3) 编辑
摘要: search : 找到返回位置; 找不到返回 -1 var str, p, n; str = '1:abc;2:Abc;3:aBc;4:abC;5:ABc;6:aBC;7:AbC;8:ABC'; p = /abc/i; n = str.search(p); alert(n); //2 p = /abcde/i; n = str.search(p); alert(n); //-1 //这个... 阅读全文
posted @ 2009-03-05 21:20 万一 阅读(2023) 评论(1) 推荐(0) 编辑
摘要: 建立正则表达式的方法 var p1 = new RegExp("abc", "igm"); var p2 = RegExp("abc", "igm"); var p3 = /abc/igm; //判断是否是正则表达式对象 alert(p1 instanceof RegExp); //true alert(p2 instanceof RegExp); //true alert(p3 insta... 阅读全文
posted @ 2009-03-05 17:05 万一 阅读(2277) 评论(0) 推荐(1) 编辑
摘要: 问题来源: http://www.cnblogs.com/del/archive/2009/03/05/1345752.html#1468654 procedure TForm1.Edit1Click(Sender: TObject); const arr: array[-1..0] of string = ('man', 'woman'); begin Edit1.Tag := n... 阅读全文
posted @ 2009-03-05 16:23 万一 阅读(2483) 评论(8) 推荐(0) 编辑
摘要: if (..) { ... } else if (..) { ... } else { ... } switch (..) { case A: ... break; case B: ... break; case C: ... break; default: ... break; } while (..) { ... } do ... while (... 阅读全文
posted @ 2009-03-04 21:42 万一 阅读(1621) 评论(0) 推荐(0) 编辑
摘要: 函数的名称function fun() { alert(123);}fun(); //123f = function() { alert(123);}f(); //123msg = alert;msg(123); //123函数的返回值function fun() { var num = 1; return num; //函数可以没有 return; 如果有 之后的代码不会被执行 num++; return num;}var r = fun();alert(r); //1函数的既定参数和实际参数/* 预定参数的个数 */function fun(a... 阅读全文
posted @ 2009-03-04 16:58 万一 阅读(1835) 评论(0) 推荐(0) 编辑
摘要: 给对象增减方法 function Rect(w, h) { this.width = w; this.height = h; } var r = new Rect(2, 3); /* 给 r 对象增加一个计算面积的方法 area() */ r.area = function() {return this.width * this.height}; alert(r.width); ... 阅读全文
posted @ 2009-03-04 12:21 万一 阅读(1643) 评论(2) 推荐(0) 编辑
摘要: prototype(原型) 是 JavaScript 中类的继承手段;一个类也不过是一组属性和方法的集合, 所谓继承就是继承属性或方法;属性是个值, 方法是个函数, JavaScript 喜欢把它们都叫成属性, 我们喜欢把它们叫做成员;JavaScript 默认让每个函数都拥有一个 prototype 对象, 它可以指向一个对象或函数(函数也是对象, 一回事);绕来绕去, 最终是四通八达...类成员与对象成员function Rect(w, h) { Rect.name = "My Rect"; //静态成员属于类, 不会被对象继承; 须冠类名调用 this.width = 阅读全文
posted @ 2009-03-04 11:45 万一 阅读(1676) 评论(0) 推荐(0) 编辑
上一页 1 ··· 67 68 69 70 71 72 73 74 75 ··· 215 下一页