如何获取被封装在对象中的实例的类型名称(字符串形式)。 我不能使用is或as运算符。 例如:
object a= student1; //student1 is instance of Student class
接下来,我需要在另一个库中获取它的对象,该库中没有Student类并且也没有引用。我需要像这样:
string typeName=GetTypeNameInsideObject(obj1)
谢谢
如何获取被封装在对象中的实例的类型名称(字符串形式)。 我不能使用is或as运算符。 例如:
object a= student1; //student1 is instance of Student class
接下来,我需要在另一个库中获取它的对象,该库中没有Student类并且也没有引用。我需要像这样:
string typeName=GetTypeNameInsideObject(obj1)
谢谢
obj.GetType()
吗? - pascalhein