a simple winform application, I try the reflection, but info is always null.
namespace WindowsFormsApplication18
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
void HelloWorld()
{
MessageBox.Show("Hello World!");
}
private void button1_Click(object sender, EventArgs e)
{
MethodInfo info = this.GetType().GetMethod("HelloWorld");
info.Invoke(this, null);
}
}
}