Tags: admin, application, create, design, form, learn, login, net, pasword, screen, sharp, sql, user, windows

how to create login screen in windows application + SQL

On .Net » .Net C# (C sharp)

1,232 words with 1 Comments; publish: Mon, 02 Jun 2008 16:50:00 GMT; (10030.76, « »)

hi there

i'm new to c sharp and i would like to learn more about it and

design the first form LOGIN so that i put admin user and pasword

i tried everything with no luck so i come here to get some help from

you guys

thanks

All Comments

Leave a comment...

  • 1 Comments
    • You can run your Logon form firt in Main event. Here is an example:

      private static bool StateLogIn = true;

      private static void Main()

      {

      // main form

      MainForm thisForm = new MainForm();

      // login form

      Login frmLogin = new Login();

      // show login form first, force user to logged on system

      frmLogin.ShowDialog();

      if (StateLogIn)

      {

      StateLogIn = false;

      if (frmLogin.DialogResult == DialogResult.OK)

      {

      Application.Run(thisForm);

      }

      else

      {

      Application.Exit();

      }

      }

      else

      {

      if (frmLogin.DialogResult == DialogResult.OK)

      {

      thisForm.Visible = true;

      }

      }

      }

      "NiGhTmArE" wrote:

      > hi there

      > i'm new to c sharp and i would like to learn more about it and

      > design the first form LOGIN so that i put admin user and pasword

      >

      > i tried everything with no luck so i come here to get some help from

      > you guys

      > thanks

      >

      #1; Mon, 02 Jun 2008 16:51:00 GMT