Hi Mansi:
Yes, you can use classes System.Reflection:
Type t = typeof(ccTestClass);
ccTestClass test = new ccTestClass();
string method = "doMethod";
Binder binder = null;
object[] invokeArgs = null;
t.InvokeMember(
method,
BindingFlags.InvokeMethod,
binder,
test,
args
);
HTH,
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Tue, 26 Oct 2004 13:49:04 -0700, "Mansi"
<Ma***@discussions.microsoft.com> wrote:
Let's say I have the following class:
class ccTestClass
{
public void doMethod()
{
}
}
If I have the name of the method stored in some variable x, such that String
x = "doMethod", how can I use introspection to call doMethod() dynamically
from within the code.
Thanks.
Mansi