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

Top 5 Contributors of the Month

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.dotnetspark.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:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply

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