I want it to be advanced like say if you pressed remember me on login then the next login it will log you in automatically.

Recommended Answers

All 17 Replies

1.You can store login info into a secret file (Content must be Encrypted).
2. Now when application run first check if the file exist
3. If exist read the content(Decrypt it and read)
4. If the Credential is authentic then Login

you need database with user and password saved.

1. Go to your project properties and click on settings tab on the left. and create a setting called UserI.
2. Create a form with 2 textboxes and name them txtUserID and txtPassword, and create a checkbox and name it chkSaveUser. A button with name btnLogin

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        txtPassword.PasswordChar = "*"
        If My.Settings.UserID <> Nothing Then
            chkSaveUser.Checked = True
            txtUserID.Text = My.Settings.UserID
        End If
    End Sub

    Private Sub btnLogin_Click(sender As System.Object, e As System.EventArgs) Handles btnLogin.Click
        'you need to decide how you want to look up the password for the matching user id
        Dim pass As String = "your password that matches your username"

        If txtPassword.Text = pass Then
            MsgBox("tada")
        Else
            MsgBox("Invalid password")
            Exit Sub
        End If

        If chkSaveUser.Checked = True Then
            My.Settings.UserID = txtUserID.Text
        Else
            My.Settings.UserID = Nothing
        End If
    End Sub

bluehangook629

It is limited for only one user. I think he wants multiple user to handled.

For example the gmail login form you can click remember me option. But after you logoff other also can use remember me option. Am i wrong??

ps. Disaster you need to post some codes for us to help you further...
post your codes.

Well guys I made this to make a file that can open only with notepad and the file will be Encrypted here the code.

Dim UserFile As String = "C:\Users\PC\Documents\Frenemy2\Userdata\username.user"
        IO.File.WriteAllText(UserFile, TextBox2.Text)

        Dim PassFile As String = "C:\Users\PC\Documents\Frenemy2\Userdata\password.pass"
        IO.File.WriteAllText(PassFile, TextBox3.Text)

sorry dude, I not a big fan of txt files and notepads so never worked with them. But if you want to use a sql db then take a look at my post, I think i have everything that you need.

Why two separate file? Try to use a single file.

And where is encryption?

Do you need encryption code?

I already got the Ecryption code and Explain what is a SQL DB please.

Do you have gtalk installed? or any other massanger?

And reading that article is hard to understand because i dont know what to change to match my settings with no errors.

I have gtalk installed my id is [snipped] you can contact me. So i can guide you. Too much delay in posting.

SQL is a database.
Wiki or Google it. you'll be better off.


*p.s. didnt know there are multiple pages to this post... sorry

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.