Here is the sample code lines,
which allows setting the priority of the process.
The process here, refers to WinForms application or Windows Service which can be seen in Task Explorer being executed as an EXE.
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.BelowNormal;
Namespace: System.Diagnostics
Class: System.Diagnostics.Process
Method: System.Diagnostics.Process.GetCurrentProcess()
--> This method allows us to get instance of the process under which the application is executed.
Property: PriorityClass
--> This property allows us to get or set the process priority
Enumerator: ProcessPriorityClass
--> This enumerator contains values as RealTime, High, AboveNormal, Normal, BelowNormal, Low. These are the same process priority levels as can be seen from Task Explorer for any windows processes.
Showing posts with label Windows Forms. Show all posts
Showing posts with label Windows Forms. Show all posts
Sunday, May 13, 2007
How to set process priority in .NET?
Posted by chirag at 6:30 AM 0 comments
Labels: .NET Examples, C# .NET, VB .NET, Windows Forms
Subscribe to:
Posts (Atom)