Get the App
SLTechnology News&Howtos  ›  Development  › 

How to operate the process in C #

Shulou Source: shulou.com Published: 2022-06-01 12:15:55 10月24日 Update

In this article, the editor introduces "how to operate the process of C#" in detail, the content is detailed, the steps are clear, and the details are handled properly. I hope this article of "how to operate the process of C#" can help you solve your doubts. Let's learn new knowledge.

Process is a running activity of a program in a computer on a certain data set, the basic unit of resource allocation and scheduling of the system, and the basis of the structure of the operating system. In the early process-oriented computer architecture, the process is the basic execution entity of the program; in the contemporary thread-oriented computer architecture, the process is the container of threads. A program is a description of instructions, data and its organizational form, and a process is the entity of a program.

1. Get all the running processes in the current program / / 1, get all the local processes Process [] pro = Process.GetProcesses (); foreach (Process p in pro) {Console.WriteLine (p.ProcessName);} 2. Kill the process: call the Process.Kill () method / / 1, get all the local processes Process [] pro = Process.GetProcesses () Foreach (Process p in pro) {/ / terminate the process p.Kill (); Console.WriteLine (p.ProcessName);} 3. Open the application / / 2 through the process, open the application Process.Start ("calc") through the process, Process.Start ("mspaint"), Process.Start ("notepad"), Process.Start ("iexplore", "http://www.baidu.com");") 4. Open the specified file ProcessStartInfo psi = new ProcessStartInfo (@ "C:\ Users\ Lenovo\ Desktop\ html.txt") through a process; Process p = new Process (); p.StartInfo = psi; p.Start () After reading this, the article "how to operate the process of C#" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Tags: Processes programs clips articles structures computers content entities applications data systems threads native applications design run proper operating systems units foundations Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info OPPO Reno Shulou Technology MariaDB Huawei