C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to get only methods from a class type using Reflection


Posted Date: 25 Jul 2008      Total Responses: 1

Posted By: Revathi Prasannaa       Member Level: Silver     Points: 1



In Reflection,
How to get only methods from a class type
The following code to gets all the properties and Methods inside ths class,
Type[] types = _assembly.GetTypes();
foreach (Type t in types)
{
MethodInfo[] methods = t.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly);
}
i used MemberType Properties of the MethodInfo Class always have the value " Method" for all the methods and properties





Responses

Author: Sabu C Alex    25 Jul 2008Member Level: GoldRating:     Points: 3

hi friend

see this code

MethodInfo[] mi = Type.GetType("System.String").GetMethods();


this will return all methods in the String class
if u pass ur class name there you will get all the methods in ur class



Post Reply
You must Sign In to post a response.
Next : how to convert string dd/mm/yyyy format to string mm/dd/yyyy format C#.NET
Previous : help me out
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use