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


VB.NET Type.AssemblyQualifiedName属性代码示例

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


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

示例1: Example

Class Example
    Public Shared Sub Main()
        Dim objType As Type = GetType(Array)

        ' Display the assembly full name.
        Console.WriteLine($"Assembly full name:{vbCrLf}   {objType.Assembly.FullName}.")

        ' Display the assembly qualified name.
        Console.WriteLine($"Assembly qualified name:{vbCrLf}   {objType.AssemblyQualifiedName}.")
    End Sub
End Class
' The example displays the following output if run under the .NET Framework 4.5:
'    Assembly full name:
'       mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
'    Assembly qualified name:
'       System.Array, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
开发者ID:VB.NET开发者,项目名称:System,代码行数:16,代码来源:Type.AssemblyQualifiedName

示例2: Example

' 导入命名空间
Imports System.Collections.Generic
Imports System.Globalization

Module Example
    Public Sub Main()
        Dim t As Type = GetType(String)
        ShowTypeInfo(t)

        t = GetType(List(Of))
        ShowTypeInfo(t)

        Dim list As New List(Of String)()
        t = list.GetType()
        ShowTypeInfo(t)

        Dim v As Object = 12
        t = v.GetType()
        ShowTypeInfo(t)

        t = GetType(IFormatProvider)
        ShowTypeInfo(t)

        Dim ifmt As IFormatProvider = NumberFormatInfo.CurrentInfo
        t = ifmt.GetType()
        ShowTypeInfo(t)
    End Sub

    Private Sub ShowTypeInfo(t As Type)
        Console.WriteLine($"Name: {t.Name}")
        Console.WriteLine($"Full Name: {t.FullName}")
        Console.WriteLine($"ToString:  {t}")
        Console.WriteLine($"Assembly Qualified Name: {t.AssemblyQualifiedName}")
        Console.WriteLine()
    End Sub
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:36,代码来源:Type.AssemblyQualifiedName

输出:

Name: String
Full Name: System.String
ToString:  System.String
Assembly Qualified Name: System.String, mscorlib, Version=4.0.0.0, Culture=neutr
al, PublicKeyToken=b77a5c561934e089

Name: List`1
Full Name: System.Collections.Generic.List`1
ToString:  System.Collections.Generic.List`1[T]
Assembly Qualified Name: System.Collections.Generic.List`1, mscorlib, Version=4.
0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Name: List`1
Full Name: System.Collections.Generic.List`1[[System.String, mscorlib, Version=4
.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
ToString:  System.Collections.Generic.List`1[System.String]
Assembly Qualified Name: System.Collections.Generic.List`1[[System.String, mscor
lib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorl
ib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Name: Int32
Full Name: System.Int32
ToString:  System.Int32
Assembly Qualified Name: System.Int32, mscorlib, Version=4.0.0.0, Culture=neutra
l, PublicKeyToken=b77a5c561934e089

Name: IFormatProvider
Full Name: System.IFormatProvider
ToString:  System.IFormatProvider
Assembly Qualified Name: System.IFormatProvider, mscorlib, Version=4.0.0.0, Cult
ure=neutral, PublicKeyToken=b77a5c561934e089

Name: NumberFormatInfo
Full Name: System.Globalization.NumberFormatInfo
ToString:  System.Globalization.NumberFormatInfo
Assembly Qualified Name: System.Globalization.NumberFormatInfo, mscorlib, Versio
n=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089


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