26-03-18, 03:41 PM
هذا الكود شغال عندي 100%
وارفقت صورة التصميم حتى تعرف الادوات المستخدمة
وارفقت صورة التصميم حتى تعرف الادوات المستخدمة
كود :
Imports System.Data.SqlClient
Public Class Login_form
Private Sub BTNlogin_Click(sender As Object, e As EventArgs) Handles BTNlogin.Click
Dim SQLQ As String = ("Select * From Mangers WHERE empuser= '" & Texuser.Text & "' and emppass= '" & Texpass.Text & "'")
Dim SQLCmnd As New SqlCommand(SQLQ, SQLcon)
Dim SQLAdptr = New SqlDataAdapter(SQLCmnd)
Dim Dt As New DataTable
Dt.Clear()
SQLAdptr.Fill(Dt)
If Dt.Rows.Count > 0 Then
MsgBox("تم تسجيل الدخول بنجاح")
MainBord_form.Show()
Me.Hide()
Else
MsgBox("اسم المستخدم او كلمة المرور غير صحيحة")
End If
End Sub
Private Sub BTNEXIT_Click(sender As Object, e As EventArgs) Handles BTNEXIT.Click
Close()
End Sub
Private Sub CheckBoxSP_CheckedChanged(sender As Object) Handles CheckBoxSP.CheckedChanged
If Texpass.UseSystemPasswordChar = True Then
' show password
Texpass.UseSystemPasswordChar = False
Else
' hide password
Texpass.UseSystemPasswordChar = True
End If
End Sub
End Class
