ProcessModule 클래스

정의

특정 프로세스에 로드된 .dll 또는 .exe 파일을 나타냅니다.

public ref class ProcessModule : System::ComponentModel::Component
public ref class ProcessModule
public class ProcessModule : System.ComponentModel.Component
public class ProcessModule
type ProcessModule = class
    inherit Component
type ProcessModule = class
Public Class ProcessModule
Inherits Component
Public Class ProcessModule
상속
상속
ProcessModule

예제

다음 코드 샘플을 사용 하는 방법에 설명 합니다 ProcessModule 가져와 Notepad.exe 애플리케이션에서 사용 되는 모든 모듈에 대 한 정보를 표시 하는 클래스입니다.

Process^ myProcess = gcnew Process;

// Get the process start information of notepad.
ProcessStartInfo^ myProcessStartInfo = gcnew ProcessStartInfo( "notepad.exe" );

// Assign 'StartInfo' of notepad to 'StartInfo' of 'myProcess' Object*.
myProcess->StartInfo = myProcessStartInfo;

// Create a notepad.
myProcess->Start();
System::Threading::Thread::Sleep( 1000 );
ProcessModule^ myProcessModule;

// Get all the modules associated with 'myProcess'.
ProcessModuleCollection^ myProcessModuleCollection = myProcess->Modules;
Console::WriteLine( "Properties of the modules  associated with 'notepad' are:" );

// Display the properties of each of the modules.
for ( int i = 0; i < myProcessModuleCollection->Count; i++ )
{
   myProcessModule = myProcessModuleCollection[ i ];
   Console::WriteLine( "The moduleName is {0}", myProcessModule->ModuleName );
   Console::WriteLine( "The {0}'s base address is: {1}", myProcessModule->ModuleName, myProcessModule->BaseAddress );
   Console::WriteLine( "The {0}'s Entry point address is: {1}", myProcessModule->ModuleName, myProcessModule->EntryPointAddress );
   Console::WriteLine( "The {0}'s File name is: {1}", myProcessModule->ModuleName, myProcessModule->FileName );
}
myProcessModule = myProcess->MainModule;

// Display the properties of the main module.
Console::WriteLine( "The process's main moduleName is: {0}", myProcessModule->ModuleName );
Console::WriteLine( "The process's main module's base address is: {0}", myProcessModule->BaseAddress );
Console::WriteLine( "The process's main module's Entry point address is: {0}", myProcessModule->EntryPointAddress );
Console::WriteLine( "The process's main module's File name is: {0}", myProcessModule->FileName );
myProcess->CloseMainWindow();
using (Process myProcess = new Process())
{
    // Get the process start information of notepad.
    ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("notepad.exe");
    // Assign 'StartInfo' of notepad to 'StartInfo' of 'myProcess' object.
    myProcess.StartInfo = myProcessStartInfo;
    // Create a notepad.
    myProcess.Start();
    System.Threading.Thread.Sleep(1000);
    ProcessModule myProcessModule;
    // Get all the modules associated with 'myProcess'.
    ProcessModuleCollection myProcessModuleCollection = myProcess.Modules;
    Console.WriteLine("Properties of the modules  associated "
        + "with 'notepad' are:");
    // Display the properties of each of the modules.
    for (int i = 0; i < myProcessModuleCollection.Count; i++)
    {
        myProcessModule = myProcessModuleCollection[i];
        Console.WriteLine("The moduleName is "
            + myProcessModule.ModuleName);
        Console.WriteLine("The " + myProcessModule.ModuleName + "'s base address is: "
            + myProcessModule.BaseAddress);
        Console.WriteLine("The " + myProcessModule.ModuleName + "'s Entry point address is: "
            + myProcessModule.EntryPointAddress);
        Console.WriteLine("The " + myProcessModule.ModuleName + "'s File name is: "
            + myProcessModule.FileName);
    }
    // Get the main module associated with 'myProcess'.
    myProcessModule = myProcess.MainModule;
    // Display the properties of the main module.
    Console.WriteLine("The process's main moduleName is:  "
        + myProcessModule.ModuleName);
    Console.WriteLine("The process's main module's base address is: "
        + myProcessModule.BaseAddress);
    Console.WriteLine("The process's main module's Entry point address is: "
        + myProcessModule.EntryPointAddress);
    Console.WriteLine("The process's main module's File name is: "
        + myProcessModule.FileName);
    myProcess.CloseMainWindow();
}
Using myProcess As New Process()
    ' Get the process start information of notepad.
    Dim myProcessStartInfo As New ProcessStartInfo("notepad.exe")
    ' Assign 'StartInfo' of notepad to 'StartInfo' of 'myProcess' object.
    myProcess.StartInfo = myProcessStartInfo
    ' Create a notepad.
    myProcess.Start()
    System.Threading.Thread.Sleep(1000)
    Dim myProcessModule As ProcessModule
    ' Get all the modules associated with 'myProcess'.
    Dim myProcessModuleCollection As ProcessModuleCollection = myProcess.Modules
    Console.WriteLine("Properties of the modules  associated with 'notepad' are:")
    ' Display the properties of each of the modules.
    Dim i As Integer
    For i = 0 To myProcessModuleCollection.Count - 1
        myProcessModule = myProcessModuleCollection(i)
        Console.WriteLine("The moduleName is " + myProcessModule.ModuleName)
        Console.WriteLine("The " + myProcessModule.ModuleName.ToString() +
                   "'s base address is: " + myProcessModule.BaseAddress.ToString())
        Console.WriteLine("The " + myProcessModule.ModuleName.ToString() +
                "'s Entry point address is: " + myProcessModule.EntryPointAddress.ToString())
        Console.WriteLine("The " + myProcessModule.ModuleName +
                                "'s File name is: " + myProcessModule.FileName)
    Next i
    ' Get the main module associated with 'myProcess'.
    myProcessModule = myProcess.MainModule
    ' Display the properties of the main module.
    Console.WriteLine("The process's main moduleName is:  " + myProcessModule.ModuleName)
    Console.WriteLine("The process's main module's base address is: " +
                            myProcessModule.BaseAddress.ToString())
    Console.WriteLine("The process's main module's Entry point address is: " +
                            myProcessModule.EntryPointAddress.ToString())
    Console.WriteLine("The process's main module's File name is: " +
                            myProcessModule.FileName)
    myProcess.CloseMainWindow()
End Using

설명

모듈 실행 파일 또는 동적 연결 라이브러리 (DLL) 됩니다. 각 프로세스의 모듈 하나 이상으로 구성 됩니다. 이 클래스를 사용하여 모듈에 대한 정보를 가져올 수 있습니다.

중요

이 형식이 구현 하는 IDisposable 인터페이스입니다. 형식을 사용 하 여 마쳤으면 직접 또는 간접적으로의 삭제 해야 있습니다. 직접 형식의 dispose 호출 해당 Dispose 의 메서드를 try/catch 블록입니다. 삭제 하지 직접, 언어 구문 같은 사용 using (C#에서) 또는 Using (Visual Basic에서는). 자세한 내용은 "를 사용 하는 개체는 구현 IDisposable" 섹션을 참조 하세요.를 IDisposable 인터페이스 항목입니다.

속성

BaseAddress

모듈이 로드된 메모리 주소를 가져옵니다.

CanRaiseEvents

구성 요소가 이벤트를 발생시킬 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
Container

IContainer을 포함하는 Component를 가져옵니다.

(다음에서 상속됨 Component)
DesignMode

Component가 현재 디자인 모드인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
EntryPointAddress

시스템에서 모듈을 로드하고 실행할 때 실행되는 함수의 메모리 주소를 가져옵니다.

Events

Component에 연결된 이벤트 처리기의 목록을 가져옵니다.

(다음에서 상속됨 Component)
FileName

모듈의 전체 경로를 가져옵니다.

FileVersionInfo

모듈의 버전 정보를 가져옵니다.

ModuleMemorySize

모듈을 로드하는 데 필요한 메모리의 양을 가져옵니다.

ModuleName

프로세스 모듈의 이름을 가져옵니다.

Site

ComponentISite를 가져오거나 설정합니다.

(다음에서 상속됨 Component)

메서드

CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
Dispose()

Component에서 사용하는 모든 리소스를 해제합니다.

(다음에서 상속됨 Component)
Dispose(Boolean)

Component에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

(다음에서 상속됨 Component)
Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetLifetimeService()
사용되지 않습니다.

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetService(Type)

Component 또는 해당 Container에서 제공하는 서비스를 나타내는 개체를 반환합니다.

(다음에서 상속됨 Component)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
InitializeLifetimeService()
사용되지 않습니다.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
ToString()

모듈 이름을 문자열로 변환합니다.

이벤트

Disposed

Dispose() 메서드를 호출하여 구성 요소를 삭제할 때 발생합니다.

(다음에서 상속됨 Component)

적용 대상