11 2006 档案

摘要: #为了增加可读性,用户可以在脚本中以行为单位插入注释(Comment).所注释的行使用“#”开头,当SHELL遇到“#”开头的行将会忽略该行#!/bin/bash#在SHELL编程中使用变量不用先声明#将字符串的值赋给变量FileFile="fiel.txt"#[-sFile]使用测试表达式(结果为true或flase)注意这里要求"["的前面和"]...阅读全文
posted @ 2006-11-30 18:47 luoweisong 阅读(359) | 评论 (0) 编辑
摘要: usingSystem;//代码风格:在为自己的Exception类命名时,以Exception结尾//实现所有的三个System.Exception构造函数,使客户所用的代码一致publicclassTestException:Exception{publicTestException():base(){Console.WriteLine("base1Exception");//可以在抛出异常时...阅读全文
posted @ 2006-11-30 18:29 luoweisong 阅读(1367) | 评论 (0) 编辑
摘要: usingSystem;usingSystem.Collections;classMyListBox{protectedArrayListdata=newArrayList();//使用索引器将对象当作数组对待.//索引器的好处就在于应用程序的书写更加自然.//在客户代码能够在对象中进行索引,就像对象是一个数组那样。publicobjectthis[intidx]{//索引器又称“智能...阅读全文
posted @ 2006-11-30 18:26 luoweisong 阅读(62) | 评论 (0) 编辑
摘要: /**using指示符使你可以列出一种搜索路径,*在编译器不能理解你键入的某个定义时,*它就会在你列出的名称空间中搜索该定义。**/usingSystem;/**注意using只应用于名称空间,而不用于类**///usingSystem.Console//错误:不能对类使用指示符using//但可以用指示符节using的变化来创建类的别名//usingalias=class;/**usingoup...阅读全文
posted @ 2006-11-30 13:55 luoweisong 阅读(370) | 评论 (0) 编辑