调用别的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);

 

posted on 2012-06-16 12:04  烟雨飘零  阅读(197)  评论(0编辑  收藏  举报

导航