摘要: 使用扩展方法,可以向一个已有类中添加新的方法. 例如, 可以创建任意方法并将它添加到string中. public static class HString { public static string ToName(this string str) { return "henw"; } }如下使用:Label1... 阅读全文
posted @ 2012-05-17 09:40 hen 阅读(567) 评论(2) 推荐(0) 编辑