Here is the code I am having problem:
[STAThread()]
static void Main(string[] args)
{
bool isPar = false;
if ((args.Length == 1)) {
if ((args(0).ToUpper() == "MYPAR")) {
isPar = true;
}
}
if (isPar == true) {
myApp myForm = new myApp();
myForm.AppStartUp(true);
} else {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new myApp());
}
}
private void AppStartUp(bool cmSwitch)
{
Application.Exit();
}
And I am running my application under windows task scheduler although it
passes through Application.Exit(), the applications does not end. What might
the problem be?