Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how can made login user form application in c#.net?

how can made login user form application in c#.net?

Scheduled Pinned Locked Moved C#
csharphelpquestion
11 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mohammedali2006
    wrote on last edited by
    #1

    salam sir; how can made login user form application in c#.net?please help me. thanks sir

    mohammedali

    E K 2 Replies Last reply
    0
    • M mohammedali2006

      salam sir; how can made login user form application in c#.net?please help me. thanks sir

      mohammedali

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      Create a new form, drop two labels, two textboxes and two buttons on it.  Arrange them how you wish, set "UseSystemPasswordChar" on the textbox to be the password etc voila.  The actual code implementation will have to be down to you I'm afraid.


      My Blog[^]

      1 Reply Last reply
      0
      • M mohammedali2006

        salam sir; how can made login user form application in c#.net?please help me. thanks sir

        mohammedali

        K Offline
        K Offline
        Kristian Sixhoj
        wrote on last edited by
        #3

        An example of the code to check the entered credentials could be:

        private void buttonLogin_Click(object sender, EventArgs e)
        {
        if (txtPassword.Text == "abc123" && txtUsername.Text == "admin")
        {
        MessageBox.Show("You are now logged in!");
        // ...
        }
        else
        {
        MessageBox.Show("Wrong password or username!");
        }
        }

        The rest is up to you.

        Virtual1ty -- "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

        D 1 Reply Last reply
        0
        • K Kristian Sixhoj

          An example of the code to check the entered credentials could be:

          private void buttonLogin_Click(object sender, EventArgs e)
          {
          if (txtPassword.Text == "abc123" && txtUsername.Text == "admin")
          {
          MessageBox.Show("You are now logged in!");
          // ...
          }
          else
          {
          MessageBox.Show("Wrong password or username!");
          }
          }

          The rest is up to you.

          Virtual1ty -- "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Please tell me you didn't post this with all sincerity??

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          K 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Please tell me you didn't post this with all sincerity??

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            K Offline
            K Offline
            Kristian Sixhoj
            wrote on last edited by
            #5

            What do you mean by that? I don't get it. (I'm Danish.)

            Virtual1ty -- "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

            D 1 Reply Last reply
            0
            • K Kristian Sixhoj

              What do you mean by that? I don't get it. (I'm Danish.)

              Virtual1ty -- "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Oh God, you were serious. :omg:

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007

              M 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Oh God, you were serious. :omg:

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007

                M Offline
                M Offline
                Muammar
                wrote on last edited by
                #7

                :laugh::laugh::laugh::laugh: You know what?? Sometimes I find this forum funnier than the lounge:-D


                Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)

                K 1 Reply Last reply
                0
                • M Muammar

                  :laugh::laugh::laugh::laugh: You know what?? Sometimes I find this forum funnier than the lounge:-D


                  Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)

                  K Offline
                  K Offline
                  Kristian Sixhoj
                  wrote on last edited by
                  #8

                  Allright, that's it. Is it the source code you are laughing at? As far as I can see the code is okay. Please let me know ;)

                  Virtual1ty -- "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

                  M 1 Reply Last reply
                  0
                  • K Kristian Sixhoj

                    Allright, that's it. Is it the source code you are laughing at? As far as I can see the code is okay. Please let me know ;)

                    Virtual1ty -- "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

                    M Offline
                    M Offline
                    Muammar
                    wrote on last edited by
                    #9

                    Hey there:) No, the code logic looks just fine to me, I think he means something else like you're giving the guy the password to set so you can hack him, some sort of a joke you know.. the way he was attaching you was the funny part:laugh:


                    Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)

                    K 1 Reply Last reply
                    0
                    • M Muammar

                      Hey there:) No, the code logic looks just fine to me, I think he means something else like you're giving the guy the password to set so you can hack him, some sort of a joke you know.. the way he was attaching you was the funny part:laugh:


                      Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)

                      K Offline
                      K Offline
                      Kristian Sixhoj
                      wrote on last edited by
                      #10

                      Oh, I see :D But as I wrote in the end of my first post: The rest is up to you. What I meant by that, was that he should change the password and username ;) Hope everything is clear now :)

                      Virtual1ty -- "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

                      D 1 Reply Last reply
                      0
                      • K Kristian Sixhoj

                        Oh, I see :D But as I wrote in the end of my first post: The rest is up to you. What I meant by that, was that he should change the password and username ;) Hope everything is clear now :)

                        Virtual1ty -- "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

                        D Offline
                        D Offline
                        Dave Kreskowiak
                        wrote on last edited by
                        #11

                        And keep it as a hard-coded username and password??? What would it take to change the password? Rewriting the app and compiling is not a viable option. What would it take to add additional users too?? How about revoking a user?? Rewriting the app again?? The code is useless, except for a demonstration of the if statement.

                        A guide to posting questions on CodeProject[^]
                        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                             2006, 2007

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups