Type.Module 속성

현재 Type이 정의된 모듈(DLL)을 가져옵니다.

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

구문

‘선언
Public MustOverride ReadOnly Property Module As Module
‘사용 방법
Dim instance As Type
Dim value As Module

value = instance.Module
public abstract Module Module { get; }
public:
virtual property Module^ Module {
    Module^ get () abstract override;
}
/** @property */
public abstract Module get_Module ()
public abstract function get Module () : Module

속성 값

현재 Type이 정의된 모듈의 이름입니다.

설명

현재 Type이 생성된 제네릭 형식을 나타내는 경우 이 속성은 형식이 정의된 모듈을 반환합니다. 예를 들어, MyGenericStack<int>의 인스턴스를 만드는 경우 생성된 형식의 Module 속성은 MyGenericStack<T>이 정의되는 모듈을 반환합니다.

마찬가지로, 현재 Type이 제네릭 매개 변수 T를 나타내는 경우 이 속성은 T를 정의하는 제네릭 형식이 포함된 어셈블리를 반환합니다.

예제

다음 예제에서는 NamespaceModule 속성과 TypeToString 메서드를 사용하는 방법을 보여 줍니다.

Imports System
Imports Microsoft.VisualBasic
Namespace MyNamespace
    Class [MyClass]
    End Class '[MyClass]
End Namespace 'MyNamespace
Public Class Type_ToString_3
    Public Shared Sub Main()
        Try
            Dim myType As Type = GetType(MyNamespace.MyClass)
            Console.WriteLine(ControlChars.NewLine + "Printing the details of {0}." + ControlChars.NewLine, myType)
            ' Get the namespace of the class Type_ToString_3.
            Console.WriteLine("Namespace: {0}.", myType.Namespace)
            ' Get the name of the module.
            Console.WriteLine("Module: {0}.", myType.Module)
            ' Get the fully qualified common language runtime namespace.
            Console.WriteLine("Fully qualified type: {0}.", myType.ToString())
        Catch e As Exception
            Console.WriteLine("Exception: " + e.Message.ToString())
        End Try
    End Sub 'Main
End Class 'Type_ToString_3
using System;
namespace MyNamespace
{
    class MyClass
    {
    }
}
public class Type_ToString_3
{
    public static void Main()
    {
        try
        {
            Type myType = typeof(MyNamespace.MyClass);
            Console.WriteLine("\nPrinting the details of {0}.\n", myType); 
            // Get the namespace of the class Type_ToString_3.
            Console.WriteLine("Namespace: {0}.", myType.Namespace);
            // Get the name of the module.
            Console.WriteLine("Module: {0}.", myType.Module);
            // Get the fully qualified common language runtime namespace.
            Console.WriteLine("Fully qualified type: {0}.", myType.ToString());
        }
        catch(Exception e)
        {
            Console.WriteLine("Exception: " + e.Message ); 
        }
    }
}
using namespace System;

namespace MyNamespace
{
   ref class MyClass{};

}

int main()
{
   try
   {
      Type^ myType = MyNamespace::MyClass::typeid;
      Console::WriteLine( "\nPrinting the details of {0}.\n", myType );
      
      // Get the namespace of the class MyClass.
      Console::WriteLine( "Namespace: {0}.", myType->Namespace );
      
      // Get the name of the module.
      Console::WriteLine( "Module: {0}.", myType->Module );
      
      // Get the fully qualified common language runtime namespace.
      Console::WriteLine( "Fully qualified type: {0}.", myType );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Exception: {0}", e->Message );
   }
}
package MyNamespace;
 
import System.*;

class MyClass
{
} //MyClass

public class Type_ToString_3
{
    public static void main(String[] args)
    {
        try {
            Type myType = MyNamespace.MyClass.class.ToType();
            Console.WriteLine("\nPrinting the details of {0}.\n", myType);

            // Get the namespace of the class Type_ToString_3.
            Console.WriteLine("Namespace: {0}.", myType.get_Namespace());

            // Get the name of the module.
            Console.WriteLine("Module: {0}.", myType.get_Module());

            // Get the fully qualified common language runtime namespace.
            Console.WriteLine("Fully qualified type: {0}.", myType.ToString());
        }
        catch (System.Exception e) {
            Console.WriteLine("Exception: " + e.get_Message());
        }
    } //main
} //Type_ToString_3

플랫폼

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에서 지원

참고 항목

참조

Type 클래스
Type 멤버
System 네임스페이스
Module