Exportar (0) Imprimir
Expandir todo

ProcessModule.ToString (Método)

Convierte el nombre del módulo en una cadena.

Espacio de nombres: System.Diagnostics
Ensamblado: System (en system.dll)

public override string ToString ()
public String ToString ()
public override function ToString () : String

Valor devuelto

El valor de la propiedad ModuleName.

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("ToString properties of the modules associated "
   +"with 'notepad' are:");
// Display the ToString of each of the modules.
for( int i=0;i<myProcessModuleCollection.Count;i++)
{
   myProcessModule = myProcessModuleCollection[i];
   Console.WriteLine(myProcessModuleCollection[i].ModuleName+" : "
      +myProcessModule.ToString());
}
// Get the main module associated with 'myProcess'.
myProcessModule = myProcess.MainModule;
// Display the ToString of the main module.
Console.WriteLine("The process's main module is : "+myProcessModule.ToString());
myProcess.CloseMainWindow();

Windows 98, Windows 2000 SP4, Windows Millennium, Windows Server 2003, Windows XP Media Center, Windows XP Professional x64, Windows XP SP2, Windows XP Starter Edition

.NET Framework no admite todas las versiones de cada plataforma. Para obtener una lista de las versiones admitidas, vea Requisitos del sistema.

.NET Framework

Compatible con: 2.0, 1.1, 1.0

Adiciones de comunidad

AGREGAR
Mostrar:
© 2014 Microsoft