Imports System.Data
Imports MySql.Data.MySqlClient
Public Class frmLogin
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim objConn As New MySqlConnection
Dim objCmd As New MySqlCommand
Dim dtAdapter As New MySqlDataAdapter
Dim ds As New DataSet
Dim dt As DataTable
Dim strConnString, strSQL As String
strConnString = "Server=hack-rc.tk;User Id=hpjobcom; Password=1949900236700; Database=hpjobcom_hackrc; Pooling=false"
strSQL = "SELECT * FROM member WHERE Username = '" & Me.txtUsername.Text & "' AND Password = '" & Me.txtPassword.Text & "' "
objConn.ConnectionString = strConnString
With objCmd
.Connection = objConn
.CommandText = strSQL
.CommandType = CommandType.Text
End With
dtAdapter.SelectCommand = objCmd
dtAdapter.Fill(ds)
dt = ds.Tables(0)
If dt.Rows.Count > 0 Then
If dt.Rows(0)("Status").ToString.ToLower.Equals("VIP") Then
MsgBox("Wellcome VIP member")
Form3.Show()
Else
MsgBox("Wellcome User Member")
Form2.Show()
Me.Hide()
End If
End If
dtAdapter = Nothing
objConn.Close()
objConn = Nothing
End Sub
Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
If MessageBox.Show("Exit application?", "", MessageBoxButtons.YesNo) = DialogResult.Yes Then
Application.Exit()
End If
End Sub
Private Sub frmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
Dim webAddress As String = "http://www.hack-rc.tk"
Process.Start(webAddress)
End Sub
End Class
If dt.Rows.Count > 0 Then
If dt.Rows(0)("Status").ToString.ToLower.Equals("VIP") Then
MsgBox("Wellcome VIP member")
Form3.Show()
Else
MsgBox("Wellcome User Member")
Form2.Show()
Me.Hide()
End If
Else <------
MsgBox("XXXX") <------
End If