AssemblyName.ToString AssemblyName.ToString AssemblyName.ToString AssemblyName.ToString Method

Definición

Devuelve el nombre completo del ensamblado, también conocido como nombre para mostrar.Returns the full name of the assembly, also known as the display name.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

Devoluciones

Nombre completo del ensamblado o nombre de la clase si no es posible determinar su nombre completo.The full name of the assembly, or the class name if the full name cannot be determined.

Ejemplos

En el ejemplo siguiente se obtiene un AssemblyName objeto para un hipotético MyAssembly.exe ensamblado y, a continuación, utiliza el ToString método para recuperar el nombre completo del ensamblado o nombre para mostrar.The following example gets an AssemblyName object for a hypothetical MyAssembly.exe assembly, and then uses the ToString method to retrieve the full assembly name, or display name.

#using <system.dll>

using namespace System;
using namespace System::Reflection;
int main()
{
   
   // Replace the string "MyAssembly.exe" with the name of an assembly,
   // including a path if necessary. If you do not have another assembly
   // to use, you can use whatever name you give to this assembly.
   //
   AssemblyName^ myAssemblyName = AssemblyName::GetAssemblyName( "MyAssembly.exe" );
   Console::WriteLine( "\nDisplaying assembly information:\n" );
   Console::WriteLine( myAssemblyName );
}


using System;
using System.Reflection;

public class AssemblyName_GetAssemblyName
{
   public static void Main()
   {
      // Replace the string "MyAssembly.exe" with the name of an assembly,
      // including a path if necessary. If you do not have another assembly
      // to use, you can use whatever name you give to this assembly.
      //
      AssemblyName myAssemblyName = AssemblyName.GetAssemblyName("MyAssembly.exe");
      Console.WriteLine("\nDisplaying assembly information:\n");
      Console.WriteLine(myAssemblyName.ToString());
   }
}
Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic

Public Class AssemblyName_GetAssemblyName
   
   Public Shared Sub Main()
      
      ' Replace the string "MyAssembly.exe" with the name of an assembly,
      ' including a path if necessary. If you do not have another assembly
      ' to use, you can use whatever name you give to this assembly.
      '
      Dim myAssemblyName As AssemblyName = AssemblyName.GetAssemblyName("MyAssembly.exe")
      Console.WriteLine(vbCrLf & "Displaying assembly information:" & vbCrLf)
      Console.WriteLine(myAssemblyName.ToString())
   End Sub 'Main 
End Class 'AssemblyName_GetAssemblyName 

Comentarios

Vea la descripción de AssemblyName para el formato de la cadena devuelta.See the description of AssemblyName for the format of the returned string.

Se aplica a