.net - How do I start a process from C#? -
how start process, such launching url when user clicks button?
as suggested matt hamilton, quick approach have limited control on process, use static start method on system.diagnostics.process class...
using system.diagnostics; ... process.start("process.exe");
the alternative use instance of process class. allows more control on process including scheduling, type of window run in and, usefully me, ability wait process finish.
using system.diagnostics; ... process process = new process(); // configure process using startinfo properties. process.startinfo.filename = "process.exe"; process.startinfo.arguments = "-n"; process.startinfo.windowstyle = processwindowstyle.maximized; process.start(); process.waitforexit();// waits here process exit.
this method allows far more control i've mentioned.
Comments
Post a Comment