日期:2014-05-18  浏览次数:20904 次

获取EXE文件中所有窗体或得到程序中所有的窗体
有没有方法得到一个EXE文件中所有的窗体信息

------解决方案--------------------
C# code

        private void Form1_Load(object sender, EventArgs e)
        {
            string strPass = @"E:\MyProgram\TestPro\API\TestLog4Net.exe";
            Assembly assebly = Assembly.LoadFrom(strPass);

            Module module = assebly.ManifestModule;
            Type[] types = m.GetTypes();
            Type tpForm = typeof(Form);

            foreach (Type type in types)
            {
                if (type.IsSubclassOf(tpForm))
                {
                    this.textBox1.Text = type.FullName;
                }
            }            
        }