标签:
////扩展方法类:必须为非嵌套,非泛型的静态类
public static class DatetimeEx
{
//通过this声明扩展的类,这里给DateTime类扩展一个Show方法,只有一个参数
public static void Show(this DateTime date, string msg)
{
Console.WriteLine("扩展方法调用");
Console.WriteLine(msg);
}
}
标签:
原文地址:http://www.cnblogs.com/fang-beny/p/5267885.html