Hello
What i am trying to do is: (windows forms)
a program starts another program using Process.Start("second_program.exe","login_key");
when second_program starts it reads the startup parameter and if the login_key is correct it starts the form, if not it shuts down
i dont know how to tell this better. Code will explain better:
PROGRAM1
Process.Start("second_program","correct_key");
SECOND_PROGRAM
static void Main(string args)
{
if(args== "correct_key")
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
MessageBox.Show("Successfully logged in!", "-", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Error", "-", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(-1);
}
}