I have C# Windows form application, I am doing a lot of check boxes and write and read them to JSON format file called test.json. Now I want to use my test.json with program.exe, that my program.exe would get check box checked as written in test.json. So I create Load event handler and want to use my GetCommandLineArgs().
private void Form1_Load(object sender, EventArgs e) { string[] args = Environment.GetCommandLineArgs(); } I know that I have 2arguments.[0] - program.exe and [1] - test.json. Need some ideas how to make it work.
My question is:
How to make that args list of 2elements. Where 0 is program.exe and 1 is test.json. And how to work with args.length when there is possibility that there will be no parameters or only one parameter


json file pathinsecondargument