As explained here
http://msdn.microsoft.com/en-us/library/ff664430(v=pandp.50).aspx[
^] the procedure for handling the start up of application is different in C# and VB. In C# the above code is to be handled in
Main
method as shown below:
static class Program {
[STAThread]
static void Main(string[] args) {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (args.Length > 0 && args[0] == "-p") {
NEC.bSetupMode = false;
NEC.bManualMode = false;
if (args.Length == 2) {
NEC.sDayEndID = args[1];
}
} else if (args.Length> 0 && args[0] == "-m") {
NEC.bSetupMode = false;
NEC.bManualMode = true;
}
Application.Run(new Form1());
}
}
To specify the command line arguments for a
Windows Forms
application in
Debug
mode in
Visual Studio
right click on the
Startup Project
in the
Solution Explorer
, select
Properties
menu option and then enter command line arguments in the
Debug
page.