System.Reflection.Assembly a = System.Reflection.Assembly.LoadFile(Application.ExecutablePath);//.net中的反射
Type[] types = a.GetTypes();
foreach (Type t in types)
{
if (t.BaseType.Name == "Form")
{
MessageBox.Show(t.Name);
}
}
foreach(Form f in Application.OpenForms)
{
Console.WriteLine(f.Text);
}