winform调用plugin

winform插件开发:

try
            {
                System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFrom(Application.StartupPath + "\\Kuwait2GNSNForms.dll");
 
                Type[] types = assembly.GetTypes();
 
 
                foreach (Type type in types)
                {
                    if (type.FullName == "Kuwait2GNSNForms.Channel_Match")
                    {
                        object obj = Activator.CreateInstance(type);
                        Form window = (System.Windows.Forms.Form)obj;
                        window.StartPosition = FormStartPosition.CenterScreen;
                        window.ShowDialog();
                        break;
                    }
                }
            }
            catch(Exception exception)
            {
                MessageBox.Show(this,exception.Message);
            }
原文地址:https://www.cnblogs.com/hongjiumu/p/3033258.html