Вы находитесь на странице: 1из 1

Imports System.Data.

OleDb
Public Class login
Dim con As OleDbConnection
Dim val As Boolean
Dim sel As OleDbCommand
Dim reader As OleDbDataReader
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
sel = New OleDbCommand("select * from login where user='" &
TextBox1.Text & "'and pass='" & TextBox2.Text & "' ", con)
reader = sel.ExecuteReader
While reader.Read
val = True
End While
If val Then
ProgressBar1.Visible = True
Timer1.Enabled = True
Else
TextBox1.Text = ""
TextBox2.Text = ""
MsgBox("Type correct password")
End If
End Sub

Private Sub login_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
con = New
OleDbConnection("provider=microsoft.jet.oledb.4.0;data
source=F:\11666\project\dictionary\dictionary.mdb")
con.Open()
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value = ProgressBar1.Value + 5
If ProgressBar1.Value = 100 Then
Timer1.Enabled = False
ProgressBar1.Visible = False
home.Show()
Me.Hide()
End If
End Sub

End Class

Вам также может понравиться