Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how can i get the class name with system.reflection?

Posted on 2009-04-22
3
Medium Priority
?
2,159 Views
Last Modified: 2013-12-17
hello experts,

how can i recover the class name,
i'd like to print as follow.
error : class->method

i found out how to display the method with
system.reflection.methodbase.GetCurrentMethod.name

but how to recover the class name ,

thanks in advance.
0
Comment
Question by:toshi_
  • 2
3 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 24204169
Reflection in C# - List of Class Name, Method Name
http://dotnetguts.blogspot.com/2008/12/reflection-in-c-list-of-class-name.html
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 750 total points
ID: 24204183
Assembly asm = Assembly.Load("ConsoleApplication1.DenemeClassLibrary");
            Type[] types = asm.GetTypes();
            foreach (Type t in types)
            {
                if (t.BaseType == typeof(MarshalByRefObject))
                {
                    Console.WriteLine("Marshal By ref {0} ",t.FullName);
                }
                else
                {
                    Console.WriteLine("Not Marshal By ref {0}",t.FullName);
                }
            }
0
 

Author Comment

by:toshi_
ID: 24204593
thank you Dhaest,
the GetType.......as i found it on my class gave me what i was looking for,
i didn't need reflection ;o)

thank you , you got the points.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Six Sigma Control Plans
Loops Section Overview

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question