Results 1 to 16 of 16

Thread: forgot password form in vb6?

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    14

    Cool forgot password form in vb6?

    Hi!

    I have a login form, I'm planning to create a form that when you forgot your password you can retrieve your account just like Facebook..
    in the forgot password form there's a question that you will answer..
    the question is the hint to retrieve the password..
    thank you!

  2. #2
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,834

    Re: forgot password form in vb6?

    Interesting and good for you :-)

    Is there a question?
    Last edited by TysonLPrice; Feb 23rd, 2012 at 07:30 AM.

  3. #3

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    14

    Re: forgot password form in vb6?

    yup! can you help for that?
    thank you

  5. #5
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,834

    Re: forgot password form in vb6?

    I was just kidding but most everyone here is willing to help. We need to know how far along are you and are there issues. In other words do you have specific questions?

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    14

    Re: forgot password form in vb6?

    i have a login form, if i forgot the password how can i open the program?
    what is the alternative way?
    the only way i think is to put a forgot password at the bottom of the form.

  7. #7
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,834

    Re: forgot password form in vb6?

    RhinoBull got the ball rolling...And you will retrieve it from where?

    Where are the password and ID stored now? Database, textfile, in the program, etc. Without knowing that we can't help designing where\how the "forgot password" logic should be created.

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: forgot password form in vb6?

    I'm not sure it really matters.

    The important thing is that you have the info for retrieval from somewhere. This means you need the question, the correct answer, and the password itself.

    Usually though you never want to store passwords at all, but instead you store a one-way hash of the password. This means if they forget and go through the Q&A successfully, you reset to some random password and give that to them. Then they have the option of changing it to another password through your "change password" process.

    Basically there isn't a thing tricky here, just a few forms or dialogs:

    Logon
    Forgot My Password
    Change My Password

    Storing hashed passwords is another topic, but one you should address anyway. If not, then anyone who gets hold of your user/pw store (whether it's in a database or anything else) can steal everyone's identity.

    http://blog.moertel.com/articles/200...-in-a-database
    Last edited by dilettante; Feb 23rd, 2012 at 10:22 AM.

  9. #9

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    14

    Re: forgot password form in vb6?

    that is the thing that i would like to ask
    Last edited by Markee; Feb 23rd, 2012 at 10:27 AM. Reason: wrong typing

  10. #10

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    14

    Re: forgot password form in vb6?

    i need some help please
    post any sample code pls

    i have a login form and register form using module..

    i need some help..
    for my thesis...
    Last edited by Markee; Feb 24th, 2012 at 08:18 AM.

  11. #11
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: forgot password form in vb6?

    OK, it is for your thesis, right - do you expect us to do everything for you?

    What have you done so far?
    You haven't answered a single question that was asked by the people trying to help you in this thread. We cannot just whip up code magically without knowing certain details.

    So please, help us help you!

  12. #12

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    14

    Re: forgot password form in vb6?

    Sorry! ok, i have a login form and you can also register a new username and password,
    now if you forgot the your password you can retrieve, reset or change it from the other form
    i'm using .urs file saving my username and password.

    thank you

    this is my code in register a new user using module

    Public Sub TryLogin()
    On Error GoTo A
    Dim user, pass, RUser, Rpass As String
    user = Form1.Text1.Text
    pass = Form1.Text2.Text
    Open App.Path & "/Users/" & user & ".urs" For Input As #1
    Input #1, RUser
    Input #1, Rpass
    Close #1
    If user = RUser Then
    If pass = Rpass Then
    GoTo Login
    Else
    End If
    End If
    MsgBox "Invalid Password", vbCritical, "Invalid Info"
    Exit Sub
    Login:
    Form3.Show
    Form1.Hide
    Exit Sub
    A:
    MsgBox "Invalid Username", vbCritical, "Invalid Info"
    End Sub

  13. #13
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: forgot password form in vb6?

    In that case you could just look at the user.urs file with notepad and see what the password is

    Seriously though first you need to determine what you want to do if they click the forgot password. Once you have determined that then you would try to determine how to write the code to achive the result you want.

    It should be pretty easy.

  14. #14
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: forgot password form in vb6?

    You need to go back to the beginning; the Registration of the User in the first place.

    When you register a user (or a user registers themselves) you need to save some information, vis:

    1. The Username
    2. The Password
    3. The Question to be asked in the case the user forgets their password
    4. The answer to the question

    (Before storing the information you will have to make sure that the Username does not already exist)

    Then, if the user selects 'Forgot Password', you just display the question, input the asnwer from the user, if their answer matches the one you've stored you can then either allocate a random password or display the current one.

  15. #15
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: forgot password form in vb6?

    From the looks of the current code it only works for 1 user, the first user.

    Also note that you should do away with the Goto no need for it and it is not good coding practice.

  16. #16

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    14

    Re: forgot password form in vb6?

    sorry wrong code that's for log in.
    this is for register

    Code:
    Public Sub Createuser()
    On Error GoTo A
    Dim user, pass As String
    user = Form2.Text1.Text
    pass = Form2.Text2.Text
    Open App.Path & "/Users/" & user & ".urs" For Output As #1
    Print #1, user
    Print #1, pass
    Close #1
    MsgBox "Your account has been created", vbInformation, "Congratulations"
    Form2.Text1.Text = ""
    Form2.Text2.Text = ""
    Exit Sub
    A:
    MsgBox "Can't Make Account", vbCritical, "Error"
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width