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
19.2.MethodInfo | ||||
19.2.1. | Get a parameterless method named MethodA for that type, and executes the method. | |||
19.2.2. | Use Reflection to get all method names | |||
19.2.3. | Use Reflection to get all member names | |||
19.2.4. | Use the DefinePInvokeMethod method to create a PInvoke method | |||
19.2.5. | Add the MethodImplAttributes.PreserveSig flag to the method implementation flags |