C# 静态方法中获取类的名称

静态方法中用:

string className = System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.FullName;

 

非静态方法中还可以用:

string className = this.GetType().FullName;

posted on 2009-03-23 22:13 大豆男生 阅读(512) 评论(0) 编辑 收藏

导航

公告

统计