Loading
Public Class Loading
Private Sub Loading_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Start() CircularProgress1.IsRunning = Not CircularProgress1.IsRunning End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick CircularProgress1.Minimum = CircularProgress1.Minimum + 2 lbl_time.Text = CircularProgress1.Minimum If lbl_time.Text = CircularProgress1.Maximum Then Main.Show() Me.Close() Timer1.Stop() End If End Sub
Private Sub CircularProgress1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CircularProgress1.ValueChanged
End Sub
End Class
Log-in
Imports System.Data.OleDb
Public Class Login Public constr As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|datadirectory|\atm.accdb;persist security info= false" Public con As New OleDbConnection Private Sub Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con.ConnectionString = constr If con.State = ConnectionState.Closed Then con.Open() End If End Sub Private Sub btn_login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_login.Click Dim dr As OleDbDataReader Dim cmd As New OleDbCommand cmd.Connection = con cmd.CommandText = "SELECT * FROM Account WHERE Username = '" & txt_user.Text & "' and Password = '" & txt_pin.Text & "'" dr = cmd.ExecuteReader
If dr.HasRows = False Then MsgBox("INVALID USERNAME OR PIN CODE", vbCritical) Exit Sub End If Loading.Show() Me.Hide() With dr.Read