Process.MainModule Property
Gets the main module for the associated process.
[Visual Basic] Public ReadOnly Property MainModule As ProcessModule [C#] public ProcessModule MainModule {get;} [C++] public: __property ProcessModule* get_MainModule(); [JScript] public function get MainModule() : ProcessModule;
Property Value
The ProcessModule that was used to start the process.
Exceptions
| Exception Type | Condition |
|---|---|
| NotSupportedException | You are attempting to access this property for a process on a remote computer. |
Remarks
A process module represents a .dll or .exe file that is loaded into a particular process. The MainModule property lets you view information about the executable used to start the process, including the module name, file name, and module memory details.
Windows 98 Platform Note: This property is not available on this platform if you started the process with ProcessStartInfo.UseShellExecute set to true.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
.NET Framework Security:
- SecurityPermission for calling any members of System.Diagnostic.Process with full trust. Associated enumeration: PermissionState.Unrestricted
See Also
Process Class | Process Members | System.Diagnostics Namespace | Modules