Hi friends,
I have query that is any possible function which can actually tells us that How do we find out the number of parameters passed into function?
Thanks
Find number of parameters
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Dec 24, 2011, 1:56 AM EST
using System;
using System.Reflection;
class MyClass
{
public void MyMethod(int i, double d, string s)
{
// do something
}
}
class Test
{
static void Main()
{
Type t = typeof(MyClass);
MethodInfo mi = t.GetMethod("MyMethod");
int count = CountParameters(mi);
Console.WriteLine(count); // 3
Console.ReadKey();
}
static int CountParameters(MethodInfo mi)
{
return mi.GetParameters().Length;
}
}