ParameterInfo.ParameterType Property gets the Type of this parameter.
Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic
Class parminfo
Public Shared Sub mymethod(int1m As Integer, ByRef str2m As String, _
ByRef str3m As String)
str2m = "in mymethod"
End Sub
Public Shared Function Main() As Integer
Dim Mytype As Type = GetType(parminfo)
Dim Mymethodbase As MethodBase = Mytype.GetMethod("mymethod")
Console.Write("Mymethodbase = " + Mymethodbase.ToString())
Dim Myarray As ParameterInfo() = Mymethodbase.GetParameters()
Dim Myparam As ParameterInfo
For Each Myparam In Myarray
Console.Write(Myparam.Position.ToString() + ", the ParameterType is - " + Myparam.ParameterType.ToString())
Next Myparam
Return 0
End Function
End Class
Related examples in the same category