|
Este artículo se tradujo de forma manual. Mueva el puntero sobre las frases del artículo para ver el texto original.
|
Traducción
Original
|
ProcessThread.IdealProcessor (Propiedad)
Ensamblado: System (en System.dll)
Valor de propiedad
Tipo: System.Int32| Excepción | Condición |
|---|---|
| Win32Exception | |
| PlatformNotSupportedException | |
| NotSupportedException |
using System; using System.Diagnostics; namespace ProcessThreadIdealProcessor { class Program { static void Main(string[] args) { // Make sure there is an instance of notepad running. Process[] notepads = Process.GetProcessesByName("notepad"); if (notepads.Length == 0) Process.Start("notepad"); ProcessThreadCollection threads; //Process[] notepads; // Retrieve the Notepad processes. notepads = Process.GetProcessesByName("Notepad"); // Get the ProcessThread collection for the first instance threads = notepads[0].Threads; // Set the properties on the first ProcessThread in the collection threads[0].IdealProcessor = 0; threads[0].ProcessorAffinity = (IntPtr)1; } } }
Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.