从C#的基类中,获取派生类型?
假设我们有以下两个类: public class Derived : Base { public Derived(string s) : base(s) { } } public class Base { protected Base(string s) { } } 我怎样才能从内部的构造函数中找出Base那Derived是调用?这是我想出的: public class Derived : Base { public Derived(string s) : base(typeof(Derived), s) { } } public class Base { protected Base(Type type, string s) …