Assembly.FullName Tulajdonság

Definíció

Lekéri a szerelvény megjelenítendő nevét.

public:
 virtual property System::String ^ FullName { System::String ^ get(); };
public virtual string FullName { get; }
public virtual string? FullName { get; }
member this.FullName : string
Public Overridable ReadOnly Property FullName As String

Tulajdonság értéke

A szerelvény megjelenítendő neve.

Megvalósítás

Példák

Az alábbi példa lekéri az aktuálisan végrehajtó szerelvény megjelenítendő nevét és a Int32 típust tartalmazó szerelvény megjelenítendő nevét (int a C#-ban, Integer Visual Basic).

using System;
using System.Reflection;

class Example
{
    static void Main()
    {
        Console.WriteLine("The FullName property (also called the display name) of...");
        Console.WriteLine("...the currently executing assembly:");
        Console.WriteLine(typeof(Example).Assembly.FullName);

        Console.WriteLine("...the assembly that contains the Int32 type:");
        Console.WriteLine(typeof(int).Assembly.FullName);
    }
}

/* This example produces output similar to the following:

The FullName property (also called the display name) of...
...the currently executing assembly:
ExampleAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
...the assembly that contains the Int32 type:
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
 */
Imports System.Reflection

Class Example
    Shared Sub Main()
        Console.WriteLine("The FullName property (also called the display name) of...")
        Console.WriteLine("...the currently executing assembly:")
        Console.WriteLine(GetType(Example).Assembly.FullName)

        Console.WriteLine("...the assembly that contains the Int32 type:")
        Console.WriteLine(GetType(Integer).Assembly.FullName)
    End Sub 
End Class 

' This example produces output similar to the following:
'
'The FullName property (also called the display name) of...
'...the currently executing assembly:
'ExampleAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
'...the assembly that contains the Int32 type:
'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Megjegyzések

Tekintse meg AssemblyName a szerelvény megjelenítendő nevének formátumát.

Note

Nem ajánlott saját kódot írni a megjelenítendő nevek elemzéséhez. Ehelyett adja át a megjelenítendő nevet a AssemblyName konstruktornak, amely elemzi és feltölti az új AssemblyNamemezőit.

A .NET Framework 2.0-s verziójában a processzorarchitektúra hozzáadódik a szerelvényidentitáshoz, és szerelvénynév-sztringek részeként adható meg. Kompatibilitási okokból azonban nem szerepel a FullName tulajdonság által visszaadott sztringben. Lásd a(z) AssemblyName.ProcessorArchitecture.

A következőre érvényes:

Lásd még