You Are Here : Home » , , » VB.Net call method from DLL

VB.Net call method from DLL



your code in Test.dll


Public Module Class1
    Public Sub Show()
        MsgBox("It works", MsgBoxStyle.Information, "Success")
    End Sub
End Module



use the following code to run:

Dim assem As System.Reflection.Assembly = Assembly.LoadFrom("Testdll.dll")
Dim ty As Type = assem.GetType("Testdll.Class1")
Dim class1 As Object = Activator.CreateInstance(ty)
class1.Show()

 'or class1.GetType().GetMethod("Show").Invoke(Nothing,Nothing,Nothing,Nothing,Nothing)


No comments:

Leave a Reply

Copyright © Source Code Hacking. Designed by Momizat Team. Powered to Blogger by SpicyTweaks.

Scroll to top