Running a .exe application from Windows forms

不想你离开。 提交于 2019-11-29 06:52:38

You need to use the Process class:

Process.Start(@"C:\some_location\myapplication.exe");

For arguments:

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = @"C:\some_location\myapplication.exe";
startInfo.Arguments = "header.h";
Process.Start(startInfo);

Obviously you can pull these names/arguments from text boxes.

Aghilas Yakoub

You can try with this code:

ProcessStartInfo startInfo = new ProcessStartInfo("yourExecutable.exe");

startInfo.Arguments = "header.h"; // your arguments

Process.Start(startInfo);

https://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.useshellexecute.aspx

These link will provide you full information about .exe process Info.

another way that i used is

ProcessStartInfo objProcess = new ProcessStartInfo(@"Yours .exe path");
objProcess.UseShellExecute = false;
objProcess.RedirectStandardOutput = true;
Process.Start(objProcess);

and it's working fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!