Export (0) Print
Expand All

Process.BasePriority Property

Gets the base priority of the associated process.

Namespace:  System.Diagnostics
Assembly:  System (in System.dll)

member BasePriority : int with get

Property Value

Type: System.Int32
The base priority, which is computed from the PriorityClass of the associated process.

ExceptionCondition
PlatformNotSupportedException

The platform is Windows 98 or Windows Millennium Edition (Windows Me); set the ProcessStartInfo.UseShellExecute property to false to access this property on Windows 98 and Windows Me.

InvalidOperationException

The process has exited.

-or-

The process has not started, so there is no process ID.

The BasePriority of the process is the starting priority for threads created within the associated process. You can view information about the base priority through the System Monitor's Priority Base counter.

Based on the time elapsed or other boosts, the operating system can change the base priority when a process should be placed ahead of others.

The BasePriority property lets you view the starting priority assigned to a process. However, because it is read-only, you cannot use the BasePriority to set the priority of the process. To change the priority, use the PriorityClass property. The BasePriority is viewable using the System Monitor, while the PriorityClass is not. Both the BasePriority and the PriorityClass can be viewed programmatically. The following table shows the relationship between BasePriority values and PriorityClass values.

BasePriority

PriorityClass

4

Idle

8

Normal

13

High

24

RealTime

Windows 98, Windows Millennium Edition Platform Note: This property is not available on this platform if you started the process with ProcessStartInfo.UseShellExecute set to true.

The following example starts an instance of Notepad. The example then retrieves and displays various properties of the associated process. The example detects when the process exits, and displays the process's exit code.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

  • LinkDemand 

    for full trust for the immediate caller. This member cannot be used by partially trusted code.

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft