C
CSharpNewBie
Hi
I am creating a Winform application and I need help. Let me explain my
problem
This is what i do on startup, I create a form (a Login screen) at runtime
and that will ask user to enter a user/password on entering the password the
form will check the local file to authenticate, (encrypted file) then it
will return true in (loadLoginForm) else false if the used clicked cancel
based on the that input I have to load the main form. everything works but
the problem is even though it ignores the Initialcomponent on cancel but the
Main() gets executed. How can I close the application if the user clicks
cancel exit out without going in Main()
public FrmMain()
{
if (LoadLoginForm())
{InitializeComponent();}
else
{this.Close();} // this means user clicked cancel close the application.
}
[STAThread]
static void Main()
{
Application.Run(new FrmMain()); // I dont want this to execute if user
clicks cancel on the login screen
}
Thanks
Arun
I am creating a Winform application and I need help. Let me explain my
problem
This is what i do on startup, I create a form (a Login screen) at runtime
and that will ask user to enter a user/password on entering the password the
form will check the local file to authenticate, (encrypted file) then it
will return true in (loadLoginForm) else false if the used clicked cancel
based on the that input I have to load the main form. everything works but
the problem is even though it ignores the Initialcomponent on cancel but the
Main() gets executed. How can I close the application if the user clicks
cancel exit out without going in Main()
public FrmMain()
{
if (LoadLoginForm())
{InitializeComponent();}
else
{this.Close();} // this means user clicked cancel close the application.
}
[STAThread]
static void Main()
{
Application.Run(new FrmMain()); // I dont want this to execute if user
clicks cancel on the login screen
}
Thanks
Arun