have a class, can I get the full type name in the form like A,B?
Use AssemblyQualifiedName
on the Type instance:
typeof(string).AssemblyQualifiedName
Or:
typeof(YourClass).AssemblyQualifiedName
Also, if you have an instance of an object, and want to know the full type name from that; use GetType()
to get the Type instance from the instance.
You can also use Type.FullName in case you're not interested in the assembly properties
Following your example:
typeof(A).FullName;
or from an instance of A:
anA.GetType().FullName;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With