Let's say that you have 2 applications:
C:\Apps\app1.exe
C:\Apps\app1.exe.config
C:\Apps\app2.exe
C:\Apps\app2.exe.config
You can create buttons to start those applications by creating them and adding the following Button.Click event handlers:
| usingSystem.Diagnostics; |
|
| privatevoidbtnStartApp1_Click(objectsender,EventArgse) |
| { |
| Processapp1=newProcess(); |
|
| app1.StartInfo.FileName=@"C:\Apps\app1.exe"; |
| //app1.StartInfo.Arguments="arg1";ifyouneedtopassargumentstoexe. |
|
| app1.Start(); |
| } |
|
| privatevoidbtnStartApp2_Click(objectsender,EventArgse) |
| { |
| Processapp2=newProcess(); |
|
| app2.StartInfo.FileName=@"C:\Apps\app2.exe"; |
| //app2.StartInfo.Arguments="arg1";ifyouneedtopassargumentstoexe. |
|
| app2.Start(); |
| } |
Tomi Airaksinen - MCPD [Remember to click "mark as answered" when you get a correct reply to your question]