获取C#中exe程序的实例名

获取sanjiao.frmsanjiao

            string strPass = @"D:\WinAutoTest\sanjiao.exe";
            Assembly assebly = Assembly.LoadFrom(strPass);

            Module module = assebly.ManifestModule;
            Type[] types = module.GetTypes();

            Type tpForm = typeof(Form);

            foreach (Type type in types)
            {
                if (type.IsSubclassOf(tpForm))
                {                  
                    MessageBox.Show(type.FullName);
                }
            }        

 

posted @ 2013-07-20 22:02  quanzhan  阅读(1165)  评论(0编辑  收藏  举报