Assembly.FullName Proprietà

Definizione

Ottiene il nome visualizzato dell'assembly.Gets the display name of the assembly.

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

Valore della proprietà

Nome visualizzato dell'assembly.The display name of the assembly.

Implementazioni

Esempi

Nell'esempio seguente viene recuperato il nome visualizzato dell'assembly attualmente in esecuzione e il nome visualizzato dell'assembly che contiene il tipo di Int32 (int in C#Integer in Visual Basic).The following example retrieves the display name of the currently executing assembly, and the display name of the assembly that contains the Int32 type (int in C#, Integer in Visual Basic).

using namespace System;
using namespace System::Reflection;

void main()
{
    Console::WriteLine("The FullName property (also called the display name) of...");
    Console::WriteLine("...the currently executing assembly:");
    Console::WriteLine(Assembly::GetExecutingAssembly()->FullName);

    Console::WriteLine("...the assembly that contains the Int32 type:");
    Console::WriteLine(int::typeid->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
 */
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

Commenti

Per una descrizione del formato del nome visualizzato di un assembly, vedere AssemblyName.See AssemblyName for a description of the format of the display name of an assembly.

Nota

Non è consigliabile scrivere codice personalizzato per analizzare i nomi visualizzati.Writing your own code to parse display names is not recommended. Al contrario, passare il nome visualizzato al costruttore AssemblyName, che lo analizza e popola i campi appropriati della nuova AssemblyName.Instead, pass the display name to the AssemblyName constructor, which parses it and populates the appropriate fields of the new AssemblyName.

In .NET Framework versione 2,0, l'architettura del processore viene aggiunta all'identità dell'assembly e può essere specificata come parte delle stringhe dei nomi degli assembly.In the .NET Framework version 2.0, processor architecture is added to assembly identity, and can be specified as part of assembly name strings. Tuttavia, non è incluso nella stringa restituita dalla proprietà FullName, per motivi di compatibilità.However, it is not included in the string returned by the FullName property, for compatibility reasons. Vedere AssemblyName.ProcessorArchitecture.See AssemblyName.ProcessorArchitecture.

Si applica a

Vedi anche