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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top