在 run-time,在 base class中,如何找到当前的子类名?
run-time
base class
If you call this.GetType() you'll always get the current runtime type regardless of the base class you're inheriting from.
this.GetType()
Get the type of the current object, then its name.
this.GetType().Name
Try this:
Type type = this.GetType().UnderlyingSystemType; String className = type.Name;