I'm using a public static class and static method with its parameters:
public static class WLR3Logon
{
static void getLogon(int accountTypeID)
{}
}
Now I am trying to fetch the method with its parameters into another class and using the following code:
MethodInfo inf = typeof(WLR3Logon).GetMethod("getLogon",
BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
int[] parameters = { accountTypeId };
foreach (int parameter in parameters)
{
inf.Invoke("getLogon", parameters);
}
But its giving me error
"Object reference not set to an instance of an object."
Where I'm going wrong.