Click here to Skip to main content
11,568,017 members (35,519 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# C#4.0
Hey
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
good
Please Sign up or sign in to vote.

Solution 1

Please use
Process.start(Firefox.exe);
  Permalink  
v2
Comments
Dominic Abraham at 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
good
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:
Process.Start(textbox1.Text);

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

Good luck,

OI
  Permalink  

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

  Print Answers RSS


Advertise | Privacy | Mobile
Web03 | 2.8.150624.2 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2015
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