AssemblyName.ToString 메서드

정의

표시 이름이라고도 하는 어셈블리의 전체 이름을 반환합니다.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

반환

어셈블리의 전체 이름 또는 전체 이름을 확인할 수 없는 경우 클래스 이름입니다.The full name of the assembly, or the class name if the full name cannot be determined.

예제

다음 예제에서는 가상 MyAssembly.exe 어셈블리에 대 한 AssemblyName 개체를 가져온 다음 ToString 메서드를 사용 하 여 전체 어셈블리 이름 또는 표시 이름을 검색 합니다.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.Reflection

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
End Class

설명

반환 된 문자열의 형식에 대 한 AssemblyName 설명을 참조 하십시오.See the description of AssemblyName for the format of the returned string.

적용 대상