<分区>
我有:
public class MyUserControl : WebUserControlBase <MyDocumentType>{...}
如果我在另一个类(class),如何获取 MyDocumentType
的类型名称?
标签 c# reflection
<分区>
我有:
public class MyUserControl : WebUserControlBase <MyDocumentType>{...}
如果我在另一个类(class),如何获取 MyDocumentType
的类型名称?
最佳答案
你可以这样使用:
typeof(MyUserControl).BaseType.GetGenericArguments()[0]
关于c# - 使用反射获取 T 的类型名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15519883/