Click here to Skip to main content
12,893,452 members (58,984 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# C#4.0
I want to know .
How to start process after select it from OpenFileDialog

OpenFileDialog ofd = new OpenFileDialog();
            ofd.Title = "XXXXXXXXXXX";
            ofd.Filter = "xxxxxxxxxxxx|xxxxxx";
            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                this.textBox1.Text = ofd.FileName;

It should put the line path of the file Ive selected to textbox1
Now , I want to make a button to launch that item I;ve selected from openfiledialog.
For example:
browse.. -> selected firefox.exe
button named 'Start' to start firefox.exe that I've selected

can anyone help me?
Posted 19-Nov-12 8:24am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please use
Dominic Abraham 19-Nov-12 21:08pm
If the solution is helpful for you, don't forget to mark it as answer. Then it will be helpful for others also.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

As Dominic said you should Process.Start method.

You can code to your button click event such as:

Here are some detailed links for you:
MSDN Process.Start Method[^]
Examples of how you can use this method[^]

Good luck,


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170424.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100