Assembly.FullName Assembly.FullName Assembly.FullName Assembly.FullName Property

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 recupera il nome visualizzato dell'assembly attualmente in esecuzione e il nome visualizzato dell'assembly che contiene il Int32 tipo (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

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

Nota

Non è consigliabile scrivere il proprio codice per analizzare i nomi visualizzati.Writing your own code to parse display names is not recommended. In alternativa, passare il nome visualizzato per il AssemblyName costruttore, che analizza e compila i campi appropriati del nuovo 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, architettura del processore viene aggiunta all'identità di assembly e può essere specificato come parte di stringhe di nomi di 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 dal FullName proprietà, 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