调用别的dll

using System.Reflection;
ShowMainForm(Application.StartupPath + "\\MainForm.dll");
private string dllPath = Application.StartupPath + “\\DLL\\”+”xx.dll”;
private void ShowMainForm(string dllPath)
        { 
            try
            {
            //唤起程序主界面
            Assembly myAssembly = Assembly.LoadFile(dllPath);
            Form tempForm = (Form)myAssembly.CreateInstance("namespace.classname",
                false, BindingFlags.Default, null,
                new object[] 
                { 
                    _currentLoginInf
                },
                null, null
        );
Comm.FormCommOperation.FormShow(tempForm);
原文地址:https://www.cnblogs.com/debuging/p/2551760.html