Geeks With Blogs
Fórmulas e Cenas Object Reference Not Set to an Instance of an Object

Type myType = typeof(MyClass);

string methodName = "methodNameAsString";

MethodInfo myTypeGetMethod = myType.GetMethod(methodName);

MyClass obj = new MyClass();

object[] parms = { 123, "string test"};

myTypeGetMethod.Invoke(obj, args);


Posted on Monday, May 31, 2010 8:41 AM Geral , Asp.Net , C# | Back to top

Comments on this post: How to: Invoke a method by name

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Sglima | Powered by: