• console调用plugin


    插件设计

    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();
            }
        }
    }
  • 相关阅读:
    [C语言
    [C语言
    [C语言
    [C语言
    [C语言
    [C语言
    [iOS]超详细Apache服务器的配置(10.10系统)
    IOS优秀博客
    「C」 数组、字符串、指针
    103.Binary Tree Zigzag Level Order Traversal(层序遍历)
  • 原文地址:https://www.cnblogs.com/hongjiumu/p/3033256.html
Copyright © 2020-2023  润新知