博文

Javascript 正则表达式(2009-11-17 19:28:00)

摘要:一, 贪心与非贪心 var reg = /c{1,}/;var str='cccccTest';reg.exec(str); 可以看到返回结果为"ccccc",说明正则表达式会尽量多的匹配。 如果我们希望正则尽量少地匹配字符,那么就可以在表示数字的符号后面加上一个?。组成如下的形式: {n,}?, {m,n}? 同样来看一个例子: var reg = /c{1,}?/;var str='ccccc'; 可以看到返回结果只有一个c,尽管有5个c可以匹配,但是由于正则表达式是非贪心模式,所以只会匹配一个。  ......

阅读全文(1592) | 评论:0

Javascript String(2009-11-17 19:17:00)

摘要:Javascript String 1. search() var test = "what is happening here";var result = test.search("is"); 结果"result = 5" search()方法返回substring的index,如果没有找到,则返回-1 2. replace() var myVar = "Hello there";var newvar = myVar.replace("e", "E"); 结果newVar为"HEllo there". 注意: myVar的值不会被改变; 替换的时候只会替换到第一个匹配的值。如果想要全部替换,可以使用正则表达式。   3.格式化strings • big: Returns the string in big tags • blink: Returns the string in blink tags • bold: Returns the string in b tags • fixed: Returns the string in tt tags (for fixed-width display) • fontcolor: Returns the string in font tags with the color attribute set to the color you specify as an argument • fontsize: Returns the string in font tags with the size attribute set to the size you specify as an argument • italics: Returns the string in i tags • small: Returns the string in small tags • strike: Returns the string in strike tags (for a strikethrougheffect) • sub: Returns the string in......

阅读全文(2596) | 评论:0

typeof 运算符(2009-11-17 18:39:00)

摘要:typeof 运算符 typeof 运算符返回一个用来表示表达式的数据类型的字符串。 可能的字符串有:"number"、"string"、"boolean"、"object"、"function" 和 "undefined"。 如: alert(typeof (123));//typeof(123)返回"number" alert(typeof ("123"));//typeof("123")返回"string" ......

阅读全文(1568) | 评论:0

如何创建CSS(2009-11-15 21:38:00)

摘要:http://www.w3school.com.cn/css/css_howto.asp   如何创建 CSS 如何插入样式表 当读到一个样式表时,浏览器会根据它来格式化 HTML 文档。插入样式表的方法有三种: 外部样式表 当样式需要应用于很多页面时,外部样式表将是理想的选择。在使用外部样式表的情况下,你可以通过改变一个文件来改变整个站点的外观。每个页面使用 <link> 标签链接到样式表。<link> 标签在(文档的)头部: <head> <link rel="stylesheet" type="text/css" href="mystyle.css" /> </head> 浏览器会从文件 mystyle.css 中读到样式声明,并根据它来格式文档。 外部样式表可以在任何文本编辑器中进行编辑。文件不能包含任何的 html 标签。样式表应该以 .css 扩展名进行保存。下面是一个样式表文件的例子: hr {color: sienna;} p {margin-left: 20px;} body {background-image: url("images/back40.gif");} 不要在属性值与单位之间留有空格。假如你使用 “margin-left: 20 px” 而不是 “margin-left: 20px” ,它仅在 IE 6 中有效,但是在 Mozilla/Firefox 或 Netscape 中却无法正常工作。 内部样式表 当单个文档需要特殊的样式时,就应该使用内部样式表。你可以使用 <style> 标签在文档头部定义内部样式表,就像这样: <head> <style type="text/css">   hr {color: sienna;}   p {margin-left: 20px;}   body {background-image: url("images/back40.gif");} </style> </head> 内联样式 由于要将表现和内容混杂在一起,内联样式会损失掉样式表的许多优势。请慎用这种方法,例如当样式仅需......

阅读全文(1637) | 评论:1

Windows 2003 server 添加桌面快速启动(2009-11-14 18:32:00)

摘要:[Shell]      Command=2      IconFile=explorer.exe,3      [Taskbar]     Command=ToggleDesktop               把这段文字复制下来             用记事本新建一个文本文件,把这段内容复制进去,保存时把类型选为“所有文件   ”,文件名“显示桌面.SCF”,成功了,就是这个图标!再把图标拖到工具栏上,“显示桌面”就回来了。  ......

阅读全文(1499) | 评论:0

sql serve r数据库中三张重要的系统表(2009-11-13 05:31:00)

摘要:sysobjects:在数据库内创建的每个对象(约束、默认值、日志、规则、存储过程等)在表中占一行。 sysindexes:数据库中的每个索引和表在表中各占一行。 syscolumns:每个表和视图中的每列在表中占一行,存储过程中的每个参数在表中也占一行。 ......

阅读全文(1770) | 评论:0

MsSql 数据类型(2009-11-12 21:04:00)

摘要: 1 bigint      从 -2^63 到 2^63-1 之间的 integer (整数)数据 2 binary        定长的binary数据,最长为8,000字节 3 bit         integer数据,值为1或0 4 char        定长的非unicode character数据,长度为8,000个字符 5 cursor        含有对游标的引用的变量或存储过程OUTPUT参数所采用的数据类型 6 datetime     date和time数据,从1753年1月1日到9999年12月31日 7 decimal        定点精度和小数的numeric数据,从-10^38-1到10^38-1之间 8 float        浮点精度数字数据,从-1.79E+308到1.79E+308之间 9 image        长度可变的binary数据,最长为2^31-1字节 10 int        从-2^31到2^31-1之间的integer(整数)数据 11 money         monetary数据值,从-2^63到2^63-1,准确度为货币单位的千分之一 12 nchar  &......

阅读全文(1824) | 评论:0

查看 .net framework 版本的方法(2009-11-12 05:51:00)

摘要:1 打开“我的电脑“,在地址栏输入  %systemroot%\Microsoft.NET\Framework 从列表中可以看出,该机器上已经装了3.5的版本     2 也可以在 控制面板 --> 程序安装, 看到系统已经安装了哪个版本的 .net framework......

阅读全文(2177) | 评论:0

如何查看Windows的版本(2009-11-12 05:29:00)

摘要:1  使用 winver 命令       2 我的电脑 --> 属性 ......

阅读全文(2122) | 评论:0

C# Regular Expression(2009-11-04 18:03:00)

摘要: http://www.radsoftware.com.au/articles/regexlearnsyntax.aspx       The basics - Finding text Text: Anna Jones and a friend went to lunch Regex: went Matches: Anna Jones and a friend went to lunch went     Matching any character with dot Text: abc def ant cow Regex: a.. Matches: abc def ant cow abc ant     Matching word characters Text: abc anaconda ant cow apple Regex: a\w\w Matches: abc anaconda ant cow apple abc ana ant app Backslash and an uppercase 'W' (\W) will match any non-word character.     Matching white-space Text: "abc anaconda ant" Regex: a\w\w\s Matches: "abc " White-space is defined as the space character, new line (\n), form feed (\f), carriage return (\r), tab (\t) and vertical tab (\v). Be careful using \s as it can lead to unexpected behaviour by matching line breaks (\n and \r). Sometimes it is better to explicitly specify the characters to match instead of using \s. e.g. to match Ta......

阅读全文(3859) | 评论:2