當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。