473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Obtaining a class' fully qualified name

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
Nov 16 '05 #1
4 4014
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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2
thanks Mattias!
that works great

Regards,
Aashish

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3
Aashish Patil <aa**********@hotmail.com> wrote:
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

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4

Thanks Jon!

Regards,
Aashish
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stefan | last post by:
I'm installing Oracle 9ias Release 2 on Windows 2000 Advanced Server. The installation instructions say to specify a fully qualified host name for the machine. What is the definition of fully...
4
by: Jim Garrison | last post by:
I know how to use the name() function to access the name of the current node. How do I get the 'fully qualified' name, consisting of the path from the root to the current node? I.e. <a> <b>...
23
by: patang | last post by:
When I create my own class, to use the functions of that class I have to create an object of that class and then I can access the functions of that class, for example: dim obj1 as myclass...
2
by: flopbucket | last post by:
Hi, If I have the following: template<class T> class A { public: int a; };
0
by: Rob Maui | last post by:
I use the following code in an aspx file to read the file name which I am uploading from the client PC onto the server; Dim MyFileName As String Dim MyFileColl As HttpFileCollection =...
49
by: Ben Voigt [C++ MVP] | last post by:
I'm trying to construct a compelling example of the need for a language feature, with full support for generics, to introduce all static members and nested classes of another type into the current...
2
by: patrimith | last post by:
Hi List, I am used to the following with Java: import some.package.MyClass; name = MyClass.class.getName(); The value for name will be "some.package.MyClass". For Python, I find:
1
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi This is from within an EXE that actaully contains the class - No external assembly I would do Class1 myClass = new Class1(); Now I want
2
by: winkerbean | last post by:
Given the following: class A { class B { A::B( A::B const & ); }; };
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.