当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET Assembly.Load方法代码示例

本文整理汇总了VB.NET中System.Reflection.Assembly.Load方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Assembly.Load方法的具体用法?VB.NET Assembly.Load怎么用?VB.NET Assembly.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Reflection.Assembly的用法示例。


在下文中一共展示了Assembly.Load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。

示例1: Class1

' 导入命名空间
Imports System.Reflection

Class Class1
    Public Shared Sub Main()
        ' You must supply a valid fully qualified assembly name.            
        Dim SampleAssembly As [Assembly] = _
            [Assembly].Load("SampleAssembly, Version=1.0.2004.0, Culture=neutral, PublicKeyToken=8744b20f8da049e3")
        Dim oType As Type
        ' Display all the types contained in the specified assembly.
        For Each oType In SampleAssembly.GetTypes()
            Console.WriteLine(oType.Name)
        Next oType
    End Sub	'LoadSample
End Class
开发者ID:VB.NET开发者,项目名称:System.Reflection,代码行数:15,代码来源:Assembly.Load

示例2: Example

' 导入命名空间
Imports System.Reflection

Module Example
   Public Sub Main()
      Dim longName As String = "system, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      Dim assem As Assembly = Assembly.Load(longName)
      If assem Is Nothing Then
         Console.WriteLine("Unable to load assembly...")
      Else
         Console.WriteLine(assem.FullName)
      End If
   End Sub
End Module
开发者ID:VB.NET开发者,项目名称:System.Reflection,代码行数:14,代码来源:Assembly.Load

输出:

system, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

示例3: Example

' 导入命名空间
Imports System.Reflection

Module Example
   Public Sub Main()
      Dim fullName As String = "sysglobl, Version=4.0.0.0, Culture=neutral, " +
                               "PublicKeyToken=b03f5f7f11d50a3a, processor architecture=MSIL"
      Dim an As New AssemblyName(fullName)
      Dim assem As Assembly = Assembly.Load(an)
      Console.WriteLine("Public types in assembly {0}:", assem.FullName)
      For Each t As Type in assem.GetTypes()
         If t.IsPublic Then Console.WriteLine("   {0}", t.FullName)
      Next
   End Sub
End Module
开发者ID:VB.NET开发者,项目名称:System.Reflection,代码行数:15,代码来源:Assembly.Load

输出:

Public types in assembly sysglobl, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a:
System.Globalization.CultureAndRegionInfoBuilder
System.Globalization.CultureAndRegionModifiers

示例4: MainClass

' 导入命名空间
Imports System
Imports System.Reflection

 
Public Class MainClass

    Shared Sub Main(  )
         Dim a As [Assembly] = [Assembly].Load("Mscorlib.dll")
         Dim theTypes As Type(  ) = a.GetTypes(  )
         Dim t As Type
         For Each t In theTypes
             Console.WriteLine("Type is {0}", t)
         Next t
         Console.WriteLine("{0} types found", theTypes.Length)

    End Sub
  
End Class
开发者ID:VB程序员,项目名称:System.Reflection,代码行数:19,代码来源:Assembly.Load


注:本文中的System.Reflection.Assembly.Load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。