Mega Code Archive

 
Categories / VB.Net / Reflection
 

Type GetConstructor (Type[])

Imports System Imports System.Reflection Imports System.Security Imports Microsoft.VisualBasic Public Class MyClass1     Public Sub New()     End Sub 'New     Public Sub New(ByVal i As Integer)     End Sub 'New     Public Shared Sub Main()         Try             Dim myType As Type = GetType(MyClass1)             Dim types(0) As Type             types(0) = GetType(Int32)             Dim constructorInfoObj As ConstructorInfo = myType.GetConstructor(types)             If Not (constructorInfoObj Is Nothing) Then                 Console.WriteLine(constructorInfoObj.ToString())             End If         Catch e As Exception             Console.WriteLine(("Source: " + e.Source))             Console.WriteLine(("Message: " + e.Message))         End Try     End Sub 'Main End Class 'MyClass1