Skip to content

Instantly share code, notes, and snippets.

@gluschenko
Created December 7, 2014 10:57
Show Gist options
  • Save gluschenko/908060b6c857f702f804 to your computer and use it in GitHub Desktop.
Save gluschenko/908060b6c857f702f804 to your computer and use it in GitHub Desktop.
using System;
using System.Reflection;
class Program
{
static void Main()
{
Type t = Type.GetType("Foo");
MethodInfo method
= t.GetMethod("Bar", BindingFlags.Static | BindingFlags.Public);
method.Invoke(null, null);
}
}
class Foo
{
public static void Bar()
{
Console.WriteLine("Bar");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment