I have an application that I run on the command prompt as follows:
C:\some_location> "myapplication.exe" headerfile.h
I want to create a Windows Forms application where the user can specify the location of the executable and also the header file so that the Windows Forms application can do this for him/her, and the user wouldn't have to go to the command line and do it.
How can I do this?
Open Solution Explorer->Click on 'solution'test'('project)->Add New Project->Select other project types from left window->Select visual studio Installer->Select the setup Wizard-> write your setup name in below(mysetup)->click OK.
" This feature is already built in to Windows Forms. Just go to the project properties and click the "Single Instance Application" checkbox. "
Perform CRUD Operations Using Entity Framework. First of all, create a Windows Forms App. To create a new app click on file menu > New > New project and select Windows Forms App then click on Next button. ProjectName - Enter your project name in this field.
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.
You can try with this code:
ProcessStartInfo startInfo = new ProcessStartInfo("yourExecutable.exe");
startInfo.Arguments = "header.h"; // Your arguments
Process.Start(startInfo);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With