Get Method Information
Imports System.Reflection
Public Class MainClass
Public Shared Sub Main()
Dim SomeObj = New Demo()
Dim MethodObj As System.Reflection.MethodInfo
Console.WriteLine()
Console.WriteLine("Methods:")
For Each MethodObj In SomeObj.GetType.GetMethods()
Console.WriteLine(MethodObj.Name & " " & MethodObj.ReturnType.ToString())
Dim Param As ParameterInfo
For Each Param In MethodObj.GetParameters()
Console.WriteLine(Param.Name & " " & Param.ParameterType.ToString())
Next
Console.WriteLine()
Next
End Sub
End Class
Class Demo
Public Sub A()
End Sub
Public Sub B(ByVal Msg As String)
End Sub
Public Function C(ByVal A As Integer, ByVal B As Integer) As Integer
End Function
Public Sub D(ByVal A As Double, ByVal B As Double, ByVal C As Double)
End Sub
End Class
Related examples in the same category