通常我可以调用this.GetType(),但不能在静态方法中访问它。我们怎么检查它呢?
发布于 2012-02-17 18:10:03
new StackFrame().GetMethod().DeclaringType
或
MethodBase.GetCurrentMethod().DeclaringType
或
new StackTrace(true).GetFrame(<frame index>).GetMethod() //e.g. <frame index> = 0
https://stackoverflow.com/questions/9326278
复制相似问题