Obtaining a class' fully qualified name

  • Thread starter Thread starter Aashish Patil
  • Start date Start date
A

Aashish Patil

Hello,

Is it possible to obtain the fully qualified name of a
class in c#. What I am looking for is something analogous
to Box.class.getName() that exists in Java.

Its possible to get this by calling GetType() on an
instance but I need to do this in a static method of the
same object whose fully qualified name is needed. Thus,
there is no instance available on which the GetType()
method can be called.

Currently, I am hard-coding (in a variable) the fully
qualified name but that does not sound like an elegant
solution.

Thanks
Aashish
 
Is it possible to obtain the fully qualified name of a
class in c#. What I am looking for is something analogous
to Box.class.getName() that exists in Java.

typeof(Box).FullName



Mattias
 
Aashish Patil said:
Is it possible to obtain the fully qualified name of a
class in c#. What I am looking for is something analogous
to Box.class.getName() that exists in Java.

typeof(Box).FullName
 
Back
Top