E Eric Dec 3, 2006 #1 Is there an easy way to get a string representation? Wasn't apparent to me from looking at the reflection class. Thanks, Eric
Is there an easy way to get a string representation? Wasn't apparent to me from looking at the reflection class. Thanks, Eric
J Jon Shemitz Dec 3, 2006 #2 Eric said: Is there an easy way to get a string representation? Wasn't apparent to me from looking at the reflection class. Click to expand... Of a type's name? The Type.Name property or Type.FullName is probably what you want. You get a runtime Type instance from typeof(ClassName) or ClassInstance.GetType().
Eric said: Is there an easy way to get a string representation? Wasn't apparent to me from looking at the reflection class. Click to expand... Of a type's name? The Type.Name property or Type.FullName is probably what you want. You get a runtime Type instance from typeof(ClassName) or ClassInstance.GetType().
D Dave Sexton Dec 3, 2006 #3 Hi Eric, Type type = typeof(System.Object); // Type known at design-time string name = type.FullName; // System.Object string qualified = type.AssemblyQualifiedName; // System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, // PublicKeyToken=b77a5c561934e089 or // Type unknown at design-time Type type = objAnyInstance.GetType();
Hi Eric, Type type = typeof(System.Object); // Type known at design-time string name = type.FullName; // System.Object string qualified = type.AssemblyQualifiedName; // System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, // PublicKeyToken=b77a5c561934e089 or // Type unknown at design-time Type type = objAnyInstance.GetType();