摘要: namespace ExtendMethods{ public static class ExtendMethod { //定义string类型的扩展方法IsRight() public static bool IsRight(this string str) { switch (str.ToUpper().Trim()) { case "RIGHT": return true; case "YES": return true; case "OK": return true; default: return false; } } //定义int类型的扩展方法IsRight() public s 阅读全文
posted @ 2010-12-29 12:44 liumeibiao 阅读(164) 评论(0) 推荐(1) 编辑