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. Visual Basic
  4. How do I recognize a wrong password ?

How do I recognize a wrong password ?

Scheduled Pinned Locked Moved Visual Basic
questionhelp
4 Posts 2 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.
  • U Offline
    U Offline
    User 11413333
    wrote on last edited by
    #1

    I'm making a school project, and in the beginning of the project i have "Register " and " Continue as Guest " so after registering, another form will open, that will require the password and the username created before. The problem is that it wont recognize if i write a wrong password or username, it will continue anyway...hope you can give me a hand, thank you ;)

    D 1 Reply Last reply
    0
    • U User 11413333

      I'm making a school project, and in the beginning of the project i have "Register " and " Continue as Guest " so after registering, another form will open, that will require the password and the username created before. The problem is that it wont recognize if i write a wrong password or username, it will continue anyway...hope you can give me a hand, thank you ;)

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

      You obviously have a problem with your logic but since you didn't show any of the relevant code, it's impossible to tell you what you did wrong.

      A guide to posting questions on CodeProject

      Click this: Asking questions is a skill. Seriously, do it.
      Dave Kreskowiak

      U 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You obviously have a problem with your logic but since you didn't show any of the relevant code, it's impossible to tell you what you did wrong.

        A guide to posting questions on CodeProject

        Click this: Asking questions is a skill. Seriously, do it.
        Dave Kreskowiak

        U Offline
        U Offline
        User 11413333
        wrote on last edited by
        #3

        you dont need to be rude ;) I just started learning this.. what I have is this : If TextBox1.Text*this is the username* = Form2.TextBox2.Text And TextBox2.Text*this is the password" = Form2.TextBox3.Text Then MsgBox("Login succeeded") Form4.Show() Me.Hide() Else MsgBox("Wrong user/password, try again") End If

        D 1 Reply Last reply
        0
        • U User 11413333

          you dont need to be rude ;) I just started learning this.. what I have is this : If TextBox1.Text*this is the username* = Form2.TextBox2.Text And TextBox2.Text*this is the password" = Form2.TextBox3.Text Then MsgBox("Login succeeded") Form4.Show() Me.Hide() Else MsgBox("Wrong user/password, try again") End If

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

          I just find it amazing that people don't know how to ask questions. Just saying "my code doesn't work" and not providing any context or description of what was done just wastes time. This happens several dozen times per day. In your case, you code is assuming there are two forms. The first is one where a user logs into the application and the second is where the username and password are being stored. This is NOT standard at all. You normally don't store usernames and passwords in forms. They are normally stored in databases, and in the case of school projects, plain text files. You might want to think about giving descriptive names to your forms and controls. Leaving them with the default names of "TextBox5" doesn't help because you have no idea what that text box is used for. The problem you're having is that you're simply comparing the wrong strings to each other and not coming up with a match.

          A guide to posting questions on CodeProject

          Click this: Asking questions is a skill. Seriously, do it.
          Dave Kreskowiak

          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