随笔分类 -  C#语法

摘要:1、定义委托:using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Web;namespace DelegateWebApp{ /// /// 定义委托 ... 阅读全文
posted @ 2014-07-28 16:55 Rhythmk 阅读(405) 评论(1) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using Autofac.Builder;using Autofac.Configuration;using Autofac;/// by rhythmknamespace AutofacApp{ class Program { static void Main(string[] args) { var builder = new ContainerBuilder()... 阅读全文
posted @ 2012-03-13 21:15 Rhythmk 阅读(787) 评论(1) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace TheStoryOfCat{ class Program { static void Main(string[] args) { Cat cat = new Cat() { Name = "Petal" }; Mouse mouse = new Mouse() { Name = "Jack" }; cat.C... 阅读全文
posted @ 2011-12-14 15:21 Rhythmk 阅读(423) 评论(0) 推荐(0)
摘要:1.常用\b 代表我们所要匹配的单词的开始处跟结尾处. 代表除换行符以外的任意字符* 并不是代表字符也不代表位置 而代表的是数量.* 意味这任意数量不包含换行的字符\d 匹配的是一位数字(0,1,2,3,4,5,6,7,8,9)- 匹配"-"\w 匹配字母或数字或下划线或汉字\s 匹配任意的空白符\b 匹配单词开始或结束^ 匹配字符串的开始$ 匹配字符串的结束2.字符转义 在查找* ,-, \ 的时候 都需要添加\\ 例如匹配 * 则应写成\*3.重复* 重复0次或者更多次+ 重复一次或者更多次? 重复0次或者一次{a} 重复a次{a,} 重复a次或者更多次{a,n} 重复 阅读全文
posted @ 2009-07-24 11:06 Rhythmk 阅读(1164) 评论(0) 推荐(0)
摘要:委托是一种数据结构,提供类似C++中函数指针的功能。不同的是C++的函数指针只能够指向静态方法.而委托还可以指向对喜爱能够实例的方法。最大的差别再于delegate是完全的面向对象且安全的类型。delegate允许编程人员再执行时期传入方法的名称.动态的决定欲调用的方法. 委托的最大特点是不知道也不关心自己引用的对象的类。任何对象中的方法都可以通过委托动态调用!只是方法的参数类型和返回类型必须与委... 阅读全文
posted @ 2009-06-25 22:28 Rhythmk 阅读(230) 评论(0) 推荐(0)

Rhythmk 个人笔记