Programming 笔记

工作中遇到的问题就记载这里

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Imports System.Reflection
Module Module1
    Private type As Type = Nothing
    Private assem As Assembly
    Private constr As ConstructorInfo
    Private parameterInfo As ParameterInfo

    Sub Main()
        assem = Assembly.LoadFrom("F:\Practice\csdn\ConsoleApplication1\ClassLibrary1\bin\Debug\ClassLibrary1.dll")
        'For Each type In assem.GetTypes()
        type = assem.GetType("ClassLibrary1.Class1")

        Console.WriteLine(type.Name.ToString)
        For Each constr In type.GetConstructors()
            For Each parameterInfo In constr.GetParameters
                Console.WriteLine("{0} {1} {2}", parameterInfo.ParameterType.FullName, parameterInfo.Name, parameterInfo.IsOptional)
            Next
        Next
        Console.Read()
    End Sub

End Module

posted on 2009-08-28 19:50  IT 笔记  阅读(166)  评论(0编辑  收藏  举报