Assembly.FullName Propriété

Définition

Obtient le nom complet de l'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

Valeur de propriété

Nom complet de l'assembly.The display name of the assembly.

Implémente

Exemples

L’exemple suivant récupère le nom complet de l’assembly en cours d’exécution et le nom d’affichage de l’assembly qui contient le type de Int32 C#(int dans, Integer dans 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

Remarques

Consultez AssemblyName pour obtenir une description du format du nom complet d’un assembly.See AssemblyName for a description of the format of the display name of an assembly.

Notes

Il n’est pas recommandé d’écrire votre propre code pour analyser les noms complets.Writing your own code to parse display names is not recommended. Au lieu de cela, transmettez le nom complet au constructeur AssemblyName, qui l’analyse et remplit les champs appropriés du nouvel AssemblyName.Instead, pass the display name to the AssemblyName constructor, which parses it and populates the appropriate fields of the new AssemblyName.

Dans le .NET Framework version 2,0, architecture du processeur est ajouté à l’identité de l’assembly et peut être spécifié dans le cadre des chaînes de nom d’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. Toutefois, il n’est pas inclus dans la chaîne retournée par la propriété FullName, pour des raisons de compatibilité.However, it is not included in the string returned by the FullName property, for compatibility reasons. Consultez AssemblyName.ProcessorArchitecture.See AssemblyName.ProcessorArchitecture.

S’applique à

Voir aussi