Type.GetMethod : Type « System « VB.Net by API






Type.GetMethod

  

Imports System
Imports System.Reflection

 
Public Class MainClass

    Shared Sub Main(  )
         Dim theMathType As Type = Type.GetType("System.Math")

         Dim paramTypes(0) As Type
         paramTypes(0) = Type.GetType("System.Double")

         Dim ConsineInfo As MethodInfo = _
             theMathType.GetMethod("Sin", paramTypes)

         Dim parameters(0) As Object
         parameters(0) = 45 * (Math.PI / 180)
         Dim returnVal As Object

         returnVal = ConsineInfo.Invoke(theMathType, parameters)
         Console.WriteLine("The sine of a 45 degree angle is {0}", _
             returnVal)
    End Sub
  
End Class

   
    
  








Related examples in the same category

1.Type.FindMembers
2.Type.GetHashCode()
3.Type.GetInterfaces()
4.Type.GetMembers()
5.Type.GetType()
6.Type.UnderlyingSystemType