using System.Reflection;
private void RunReflection()
{
MethodInfo hogeMethod = typeof(HogeStaticClass).GetMethod("HogeMethod", BindingFlags.NonPublic | BindingFlags.Static);
object[] param = new object[] { 5, null };
hogeMethod.Invoke(this, param);
Console.WriteLine(param[1]);
}
class HogeStaticClass
{
private static void HogeMethod(int n, out int m)
{
m = n + 1;
}
}