1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| Sub loading()
For i = 0 To ds.Tables("auto").Rows.Count - 1
If TextBox1.Text = ds.Tables("auto").Rows(i).Item("user") And TextBox2.Text = ds.Tables("auto").Rows(i).Item("mp") Then
Dim f2 As New menu
f2.Show()
Me.Hide()
ElseIf TextBox1.Text = ds.Tables("auto").Rows(i).Item("user") And TextBox2.Text <> ds.Tables("auto").Rows(i).Item("mp") Then
MessageBox.Show("mot de passe incorrect", "erreur", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
ElseIf TextBox1.Text <> ds.Tables("auto").Rows(i).Item("user") And TextBox2.Text = ds.Tables("auto").Rows(i).Item("mp") Then
MessageBox.Show("User introuvable", "erreur", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
ElseIf TextBox1.Text <> ds.Tables("auto").Rows(i).Item("user") And TextBox2.Text <> ds.Tables("auto").Rows(i).Item("mp") Then
MessageBox.Show("remplissez les champs vide", "erreur", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If
Next
End Sub
Private Sub authentification_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
conn = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=societe.mdb")
cmd = New OleDbCommand
With cmd
.Connection = conn
.CommandText = "select * from authentification"
End With
da = New OleDbDataAdapter(cmd)
ds = New DataSet
da.Fill(ds, "auto")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value = ProgressBar1.Value + 1
If ProgressBar1.Value = ProgressBar1.Maximum - 1 Then
Timer1.Stop()
loading()
End If
End Sub |
Partager