Help with a login

Posts 1–9 of 9 · Page 1 of 1
Help with a login
Hey guys, I pretty much got a login code and I'm trying to figure out how to make another form popup only if its correct.

This is my code so far.

Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = My.Settings.Username And
            TextBox2.Text = My.Settings.Password Then
            MsgBox("Logged In") 'if the first textbox's text is the username and the second textbox's text is the password then display a messagebox that says you're logged in.
        Else
            MsgBox("Incorrect Username or Password") 'if the username and password are incorrect then show a messagebox that says your username or password is incorrect.
        End If
    End Sub

    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        MsgBox("Your password Hint is: " + My.Settings.PasswordHint)
        'displats a messagebox with your password hint
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Form2.Show() 'shows the Create Account form so that the user can create an account.
    End Sub
End Class
Anyone know what I should do? I'm trying to add something like, but only if the login is correct:

Code:
Me.Hide()
Form3.show()
Also, can someone help me make a login system that is attached to the website? So it can be leech proof? I'm trying to make somewhat of a Multi Tool that's efficient, but I don't want it leeched.
Well i think you want to create a login form to protect from leechers, why would you let them make an account now? And everything is now stored on the pc it gets runned off
Quote Originally Posted by mamago45 View Post
Well i think you want to create a login form to protect from leechers, why would you let them make an account now? And everything is now stored on the pc it gets runned off
Yeah I know, but I can't get it right for a login for only a certain site.
..
I am not sure, but I may know a dude that can help
Quote Originally Posted by maickey95 View Post
I am not sure, but I may know a dude that can help
He couldn't help :/ And no one else is replying...So...
Erm, do you mean this? :

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = My.Settings.Username & TextBox2.Text = My.Settings.Password Then
            MsgBox("Logged In")
            Me.Hide()
            Form3.Show()
        Else
            MsgBox("Incorrect Username or Password") 'if the username and password are incorrect then show a messagebox that says your username or password is incorrect.
        End If
    End Sub
Quote Originally Posted by MugNuf View Post
Erm, do you mean this? :

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = My.Settings.Username & TextBox2.Text = My.Settings.Password Then
            MsgBox("Logged In")
            Me.Hide()
            Form3.Show()
        Else
            MsgBox("Incorrect Username or Password") 'if the username and password are incorrect then show a messagebox that says your username or password is incorrect.
        End If
    End Sub
Yes, somewhat like that

EDIT: Nvm fixed the problem

And also, would there be a way to connect it to a forum/website?
Replace the & with And.

EDIT: Oh, you fixed it. Erm, i think you can use SQL databases or something with VB. Not sure how to though, google it.
Quote Originally Posted by MugNuf View Post
Replace the & with And.

EDIT: Oh, you fixed it. Erm, i think you can use SQL databases or something with VB. Not sure how to though, google it.
Okay thanks. Well this is resolved now, I appreciate your help
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us