winform调用plugin
2013-04-20 22:45 hongjiumu 阅读(351) 评论(0) 编辑 收藏 举报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); }