Simple application of the Process class

xiaoxiao2021-03-06  69

Simple application of the Process class

People who have done private servers know that there is a "heart server manager", which is functional to launch multiple programs in this manager, or you can turn off multiple programs that have been started, how is this feature made? ? Of course, you can do it with the API function, but the most approach method may be .NET, and the method is the Process class, applying this class, a very complex problem is simple.

(1) Launch the code of the application:

Dim Proc0 As New Process

Proc0.Startinfo.fileName = TEXTBOX1.TEXT 'Application path string proc0.startinfo.arguments = "" proc0.start () procname0 = proc0.processname' process name

(2) Close the code of the application:

If proc0.hasexited <> true life, see if the process has stopped running, does not process possible exception proc0.closemainWindow () 'For the process of the window, otherwise apply the Close () function else messagebox.show ("SKFJ" , "KSAFJSA") END IF

转载请注明原文地址:https://www.9cbs.com/read-110328.html

New Post(0)