PublicSub LoadAddins()Sub LoadAddins() Dim asm As Reflection.Assembly Dim addin As InterfaceDll.Interface1 DimtabAs TabPage ForEach dll AsStringIn Directory.GetFiles(My.Application.Info.DirectoryPath, "ClassDll*.dll") asm =Assembly.LoadFile(dll) ForEach typ As Type In asm.GetTypes() If typ.IsClass AndAlso typ.IsPublic AndAlso typ.GetInterface("Interface1") IsNotNothingThen'根据此接口来调用DLL addin = Activator.CreateInstance(typ) If addin IsNotNothingThen tab=New TabPage tab.Text = addin.FormCaption tab.Name = addin.FormCaption tab.Controls.Add(addin) tab.Controls(0).Dock = DockStyle.Fill TabControl1.TabPages.Add(tab) EndIf EndIf Next Next End Sub