获取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);

                }

            }        

 

你可能感兴趣的:(exe)