console调用plugin

it2022-05-05  137

插件设计

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace ConsoleApplication1 { class Program { private static string _vsPath = @"D:\work\0411\test\Solution2\WindowsFormsApplicationTest\bin\Debug\WindowsFormsApplicationTest.exe"; static void Main(string[] args) { System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFile(_vsPath); List<System.Type> lstType = new List<Type>(); System.Type[] types = assembly.GetTypes(); lstType.AddRange(types); foreach (Type type in lstType) { if (type.FullName == "WindowsFormsApplicationTest.Form1") { object obj = Activator.CreateInstance(type); Application.EnableVisualStyles(); Application.Run((System.Windows.Forms.Form)obj); break; } } Console.WriteLine("Over"); Console.Read(); } } }

 

转载于:https://www.cnblogs.com/hongjiumu/archive/2013/04/20/3033256.html

相关资源:各显卡算力对照表!

最新回复(0)