Mega Code Archive

 
Categories / VB.Net Tutorial / Reflection
 

Loads an assembly named example exe or example dll into the current application domain

Imports System Imports System.Reflection Public Class Asmload0    Public Shared Sub Main()       Dim a As [Assembly] = [Assembly].Load("example")       Dim myType As Type = a.GetType("Example")       Dim mymethod As MethodInfo = myType.GetMethod("MethodA")       Dim obj As Object = Activator.CreateInstance(myType)       mymethod.Invoke(obj, Nothing)    End Sub  End Class