ParameterInfo.ParameterType Property gets the Type of this parameter. : ParameterInfo « Reflection « VB.Net






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

1.ParameterInfo.Attributes gets the attributes for this parameter.
2.ParameterInfo.GetCustomAttributes gets all the custom attributes defined on this parameter.
3.ParameterInfo.IsDefined
4.ParameterInfo.IsOut Property tells whether this is an output parameter.
5.ParameterInfo.Name Property returns the name of the parameter.