在我可以使用的非静态方法中this.GetType(),它将返回Type.如何Type在静态方法中获得相同的内容?当然,我不能只写,typeof(ThisTypeName)因为ThisTypeName只在运行时才知道.谢谢!
是否可以在静态函数中打印类名?
例如......
public class foo
{
static void printName()
{
// Print the class name e.g. foo
}
}
Run Code Online (Sandbox Code Playgroud)