Calling an executable from .NET

  • Thread starter Thread starter Liz
  • Start date Start date
L

Liz

I need to be able to call an executable from a .NET
solution when a button is pressed. How do I go about this??
 
Liz,

You can use the Process in combination with the ProcessStartInfo class
for this.

Example
------
ProcessStartInfo processStartInfo = new ProcessStartInfo();

processStartInfo.FileName = @"notepad.exe";
processStartInfo.Arguments = @"c:\test.txt";

Process.Start( processStartInfo );
 
Hi,
You can use the Process class in System.Diagnostics namespace to do this.

e.g.

using System.Diagnostics;
....

private void button1_Click(object sender, System.EventArgs e)
{
Process.Start("notepad.exe");
}

HTH,
APG
 
Back
Top