// Executing external applications in C#.Net (using process)
/*
Before we begin creating any methods, we must include System.Diagnostics namespace(using System.Diagnostics), witch contains the Process class.
Also, we must declare a private variable of type Process in our class.
Let's name the variable p.
*/
/// Start Your Process
private void btnStart_Click(object sender, EventArgs e)
{
Process p = new Process();
p.StartInfo.FileName = txtProcessName.Text.Trim();
p.Start();
}
/// Browse your Executable Programs
private void btnBrowse_Click(object sender, EventArgs e)
{
OpenFileDialog dlgOpenFileDialog = new OpenFileDialog();
if (dlgOpenFileDialog.ShowDialog() == DialogResult.OK)
{
txtProcessName.Text = dlgOpenFileDialog.FileName;
}
}
//In this case you can type any executable commands into the textbox (cmd,notepad,mspaint ..etc) or browse
Articles
- Articles(C#.NET) (3)
- ASP.NET (6)
- Asp.Net(Email) (1)
- Asp.net(Image) (2)
- Asp.Net(Web.Config) (2)
- C#.NET (5)
- C#.NET Threading (3)
- C#.NET(ASP.NET) (4)
- Comments in PHP (1)
- Encryption In PHP (1)
- iPhone (Articles) (1)
- JavaScript (1)
- Json with PHP (1)
- LINQ (1)
- PHP (2)
- PHP Constant (1)
- PHP Operators (1)
- PHP Print Command (1)
- PHP Tutorial (2)
- Strings In PHP (1)
- Variable Declaration In PHP (1)
- WPF (1)
- XAML (2)
About Me
Help Link
Followers
Posted by
Sreejith A.K
Thursday, September 10, 2009
comments (0)
Labels:
C#.NET
Subscribe to:
Posts (Atom)