To get all the method from a class using Reflection

Raja
Posted by Raja under C# category on | Views : 2725
To get all the method name from the class using Reflection, following code can be used.



// .dll name
Assembly asm = Assembly.Load("Mydll");
// Name of the class
Type tsm = asm.GetType("Mydll.ClassName");
foreach (MethodInfo info in tsm.GetMethods())
{
lblMessage.Text += info.Name + "<br />";

}


Thanks

Comments or Responses

Posted by: Poster on: 12/22/2009 Level:Starter | Status: [Member]
Very good Raja. I was looking for this info.

Regards
Posted by: Raja on: 12/22/2009 Level:Starter | Status: [Member]
Your welcome Raja.

Take Care.
Posted by: Raja on: 12/22/2009 Level:Starter | Status: [Member]
Please let me know if you have any more question related with this topic and i will be glad to help you.

Thanks

Login to post response