.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Ashutosh Jha
ASPEvil
Jean Paul
satyapriyanayak
SP

Post New Resource Bookmark and Share   

call class method using a string name

Posted By:Hiren Soni       Posted Date: August 29, 2010    Points: 10    Category:    URL: http://www.dotnetask.com  

call class method using a string name
 

call class method using a string name


using System.Reflection;





classdemo c1 = new classdemo();



// call function1

MethodInfo mi = typeof(classdemo).GetMethod("functionname_in_string_format");





// here function1 doesn't take any argument that's what we pass null

mi.Invoke(c1, null);

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend