다음을 통해 공유


AssemblyName.ToString 메서드

표시 이름이라고도 하는 어셈블리의 전체 이름을 반환합니다.

네임스페이스: System.Reflection
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Overrides Function ToString As String
‘사용 방법
Dim instance As AssemblyName
Dim returnValue As String

returnValue = instance.ToString
public override string ToString ()
public:
virtual String^ ToString () override
public String ToString ()
public override function ToString () : String

반환 값

어셈블리의 전체 이름 또는 클래스 이름(어셈블리의 전체 이름을 확인할 수 없는 경우)인 String입니다.

설명

반환된 문자열의 형식에 대해서는 AssemblyName의 설명을 참조하십시오.

예제

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 
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());
   }
}
#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 );
}
import System.*;
import System.Reflection.*;
import System.Text.RegularExpressions.*;

public class AssemblyNameGetAssemblyName
{
    public static void main(String[] args)
    {
        // Get the type of 'System.Object'.
        Type myType = Object.class.ToType();

        // Get the path of 'System.dll'.
        String system = Regex.Replace(myType.get_Assembly().get_CodeBase(), 
            "mscorlib.dll", "System.dll");
        system = Regex.Replace(system, "file:///", "");

        // Get the assembly information and display to the console.
        AssemblyName myAssemblyName = AssemblyName.GetAssemblyName(system);
        Console.WriteLine("\nDisplaying the assembly information of "
            + "'System.dll'\n");
        Console.WriteLine(myAssemblyName.ToString());
    } //main
} //AssemblyNameGetAssemblyName

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

AssemblyName 클래스
AssemblyName 멤버
System.Reflection 네임스페이스