Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
how to make login form in vb.net????plese give me proper coding for that and appropriate database for that........ i hope it will help me thanks....
Posted 18-Mar-12 3:01am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try reading this: Introduction to Membership[^] - it will guide you throughthe whole process.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

This might help. It's in C#, but it's easy to convert with one of the free online converters:
 
User Login For WinForm Applications[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Please follow up below link.
 
You will see how you create a Login form with many controls.
 
1. Encrypted Passwords
2. Login attempts counting
3. Blocking any UN-authorized login attempts
 
samplevbcodes.blogspot.com
 
http://www.samplevbcodes.blogspot.com/
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Imports System.Data.Odbc
Imports MySql.Data.MySqlClient
Imports System.Net.Mail
Public Class Login_Form
Dim errorclose = 1
Private Sub Login_Form_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Private Sub Login_Form_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.Enter Then
Login1_Click(sender, e)
ElseIf e.KeyCode - Keys.Enter Then
Logout1_Click(sender, e)
End If
End Sub
Private Sub Login1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login1.Click
If txtUsername.Text = "" Or txtPassword.Text = "" Then
MsgBox("Please enter UserName and Password")
txtUsername.Focus()
Else
'Connects To the Database
Try
Dim connectionstring As String = "Driver=MySQL ODBC 3.51 Driver;Server=192.168.1.12;port=3306;uid=root;pwd=admin;Database=elcott;"
Dim conn As New OdbcConnection(connectionstring)
conn.Open()
Dim myAdapter As New OdbcDataAdapter
Dim sqlquerry = "Select * From userpass where Username = '" + txtUsername.Text + "' And Password= '" + txtPassword.Text + "'"
Dim myCommand As New OdbcCommand
myCommand.Connection = conn
myCommand.CommandText = sqlquerry
'Starting The Query
myAdapter.SelectCommand = myCommand
Dim mydata As OdbcDataReader
mydata = myCommand.ExecuteReader()
'To check the Username and password and to validate the login a
If mydata.HasRows = 0 Then
If errorclose > 2 Then
MsgBox("The system is closing", MsgBoxStyle.Critical)
Application.Exit()
Else
errorclose += 1
MsgBox("Incorrect password. Please check.", MsgBoxStyle.Critical)
txtUsername.Focus()
End If
Else
Client_chat.txtChatUsername.Text = txtUsername.Text
Client_Main_Window.Show()
Me.Hide()
End If
conn.Close()
Catch myerror As OdbcException
MsgBox
End Try
txtUsername.Text = ""
        txtPassword.Text = ""
    End Sub
    Private Sub Logout1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Logout1.Click
        Application.Exit()
    End Sub
End Class
  Permalink  
Comments
vinoth1218 at 6-Mar-13 3:24am
   
Client_chat.txtChatUsername.Text = txtUsername.Text
Client_Main_Window.Show() wat this lines mean ??? plz tel client_chat.means ??
 
thank u in adavance
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 280
1 Sergey Alexandrovich Kryukov 279
2 CPallini 205
3 Maciej Los 197
4 Afzaal Ahmad Zeeshan 160
0 OriginalGriff 5,635
1 DamithSL 4,496
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 11 Nov 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100