ProcessModule Sınıf

Tanım

Belirli bir işleme yüklenen .dll veya .exe dosyasını temsil eder.

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
Devralma
Devralma
ProcessModule

Örnekler

Aşağıdaki kod örneği, Notepad.exe uygulaması tarafından kullanılan tüm modüller hakkında bilgi almak ve görüntülemek için sınıfının nasıl kullanılacağını ProcessModule gösterir.

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

Açıklamalar

Modül yürütülebilir bir dosya veya dinamik bağlantı kitaplığıdır (DLL). Her işlem bir veya daha fazla modülden oluşur. Modül hakkında bilgi almak için bu sınıfı kullanabilirsiniz.

Önemli

Bu tür arabirimini IDisposable uygular. Türünü kullanmayı bitirdiğinizde, doğrudan veya dolaylı olarak atmalısınız. Türü doğrudan atmak için yöntemini bir try/catch blokta çağırın.Dispose Bunu dolaylı olarak atmak için (C#'ta) veya Using (Visual Basic'te) gibi using bir dil yapısı kullanın. Daha fazla bilgi için arabirim konusunun "IDisposable Uygulayan Bir Nesne Kullanma" bölümüne IDisposable bakın.

Özellikler

BaseAddress

Modülün yüklendiği bellek adresini alır.

CanRaiseEvents

Bileşenin olay oluşturup oluşturamayacağını belirten bir değer alır.

(Devralındığı yer: Component)
Container

öğesini IContainer içeren öğesini Componentalır.

(Devralındığı yer: Component)
DesignMode

öğesinin şu anda tasarım modunda olup olmadığını Component gösteren bir değer alır.

(Devralındığı yer: Component)
EntryPointAddress

Sistem modülü yükleyip çalıştırdığında çalışan işlevin bellek adresini alır.

Events

Bu Componentöğesine eklenen olay işleyicilerinin listesini alır.

(Devralındığı yer: Component)
FileName

Modülün tam yolunu alır.

FileVersionInfo

Modül hakkındaki sürüm bilgilerini alır.

ModuleMemorySize

Modülü yüklemek için gereken bellek miktarını alır.

ModuleName

İşlem modülünün adını alır.

Site

öğesini alır veya ayarlar ISiteComponent.

(Devralındığı yer: Component)

Yöntemler

CreateObjRef(Type)

Uzak bir nesneyle iletişim kurmak için kullanılan bir ara sunucu oluşturmak için gereken tüm ilgili bilgileri içeren bir nesne oluşturur.

(Devralındığı yer: MarshalByRefObject)
Dispose()

Component tarafından kullanılan tüm kaynakları serbest bırakır.

(Devralındığı yer: Component)
Dispose(Boolean)

Component tarafından kullanılan yönetilmeyen kaynakları serbest bırakır ve yönetilen kaynakları isteğe bağlı olarak serbest bırakır.

(Devralındığı yer: Component)
Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetLifetimeService()
Geçersiz.

Bu örnek için yaşam süresi ilkesini denetleen geçerli yaşam süresi hizmet nesnesini alır.

(Devralındığı yer: MarshalByRefObject)
GetService(Type)

veya tarafından ComponentContainersağlanan bir hizmeti temsil eden bir nesnesi döndürür.

(Devralındığı yer: Component)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
InitializeLifetimeService()
Geçersiz.

Bu örneğin yaşam süresi ilkesini denetlemek için bir yaşam süresi hizmet nesnesi alır.

(Devralındığı yer: MarshalByRefObject)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
MemberwiseClone(Boolean)

Geçerli MarshalByRefObject nesnenin sığ bir kopyasını oluşturur.

(Devralındığı yer: MarshalByRefObject)
ToString()

Modülün adını dizeye dönüştürür.

Ekinlikler

Disposed

Bileşen yöntemine Dispose() yapılan bir çağrı tarafından atıldığında gerçekleşir.

(Devralındığı yer: Component)

Şunlara uygulanır