Opening External Applications
C#
2
Posts
2
Posters
0
Views
1
Watching
-
I have a openFileDialog which allows the user to specify the location of an application to open. He also selects times to open and close the application. Now all I need to know how to do is run the application. ;) So ... does anyone know how to execute an external application that has the path to the executable specified? Thanks!
-
I have a openFileDialog which allows the user to specify the location of an application to open. He also selects times to open and close the application. Now all I need to know how to do is run the application. ;) So ... does anyone know how to execute an external application that has the path to the executable specified? Thanks!
System.Diagnostics.Process here is an example of running PING with some arguments:
using System.Diagnostics; public void RunPing() { Process p = new Process(); p.StartInfo.Arguments = "www.codeproject.com"; p.StartInfo.FileName = "ping.exe"; p.StartInfo.WindowStyle = ProcessWindowStyle.Normal; p.Start(); p.WaitForExit(5000); // Use this to pause the code until the application closes (this one times out and continues anyway after 5 seconds) }