16-04-17, 03:20 AM
PHP كود :
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Dim con As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\work.mdb"
Dim adapt As New OleDbDataAdapter
Dim dtl As New DataTable
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
''dbase_conn()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim cn As OleDbConnection = Nothing
Dim cm As OleDbCommand = Nothing
Dim i As Integer = 0
cn = OleDbConnection(con)
cm = OleDbCommand("select count(*) from user_log where userid=@username and password=@pass", cn)
cm.Parameters.Add(New OleDbParameter("username", TextBox1.Text.Trim()))
cm.Parameters.Add(New OleDbParameter("pass", TextBox2.Text.Trim()))
cn.Open()
i = cm.ExecuteScalar
If i > 0 Then
Dim x As New Mainform
x.Show()
Else
MsgBox("اسم المسخدم او كلمة المرور خطا")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter
End Sub
Private Function OleDbConnection(ByVal con As String) As OleDbConnection
Throw New NotImplementedException
End Function
Private Function OleDbCommand(ByVal p1 As String, ByVal cn As OleDb.OleDbConnection) As OleDbCommand
Throw New NotImplementedException
End Function
End Class