I am new to c# and .net app development. Currently I built small windows form project. This project has multiple '.cs' forms. I complied the project to an executable and call it from a .net application with the command below. Everything works fine.
System.Diagnostics.Process.Start("C:\Users\WEI\Desktop\Release\DepartmentManagement.exe");
I have a new requirement to open a specific form dynamically when the executable is run. I hard coded the form I want to open by default inside "Program.cs" like below. In this example below I hard coded it to open "ProductionSystem" form by default. I want to make that dynamic.
namespace TestWinform
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new ProductionSystem());
}
}
}
I want to pass a value to the executable while executing the app. If for example I want to open the form "ProductionDowntime.cs" by default not the "ProductionSystem" then I would like to pass 'ProductionDowntime' as parameter basically making it dynamic. System.Diagnostics.Process.Start("C:\Users\WEIRepService\Desktop\Release\DepartmentDowntime.exe 'ProductionDowntime' "); I want to control this from outside the executable(not from within). Please help. Thanks in advance.