导入 System.Data.SqlClient 部分类登录继承 System.Web.UI.Page
Dim con As SqlConnection
Dim cmd As SqlCommand
Shared dr As SqlDataReader
'Shared da As SqlDataAdapter
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
con = New SqlConnection("Data source=USER-PC\SQLEXPRESS; Initial catalog= icare; Integrated security=True")
cmd = New SqlCommand("select * from userlogin where UserName='" + TextBox1.Text + "' and Password='" + TextBox3.Text + "'", con)
SqlDataReader(dr)
con.Open()
dr = cmd.ExecuteReader()
If (dr.Read()) Then
TextBox1.Text = dr("user Name").ToString
TextBox2.Text = dr("Password").ToString
'If (TextBox1.Text = TextBox1.Text And TextBox3.Text = TextBox2.Text) Then
' Response.Redirect("Defaulft.aspx")
Else
Response.Redirect("Home.master")
lbl.Visible = True
lbl.Text = "Invalid USERNAME & PASSWORD"
End If
'End If
End Sub
结束类导入 System.Data.SqlClient 部分类登录继承 System.Web.UI.Page
Dim con As SqlConnection
Dim cmd As SqlCommand
Shared dr As SqlDataReader
'Shared da As SqlDataAdapter
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
con = New SqlConnection("Data source=USER-PC\SQLEXPRESS; Initial catalog= icare; Integrated security=True")
cmd = New SqlCommand("select * from userlogin where UserName='" + TextBox1.Text + "' and Password='" + TextBox3.Text + "'", con)
SqlDataReader(dr)
con.Open()
dr = cmd.ExecuteReader()
If (dr.Read()) Then
TextBox1.Text = dr("user Name").ToString
TextBox2.Text = dr("Password").ToString
'If (TextBox1.Text = TextBox1.Text And TextBox3.Text = TextBox2.Text) Then
' Response.Redirect("Defaulft.aspx")
Else
Response.Redirect("Home.master")
lbl.Visible = True
lbl.Text = "Invalid USERNAME & PASSWORD"
End If
'End If
End Sub
结束类导入 System.Data.SqlClient 部分类登录继承 System.Web.UI.Page
Dim con As SqlConnection
Dim cmd As SqlCommand
Shared dr As SqlDataReader
'Shared da As SqlDataAdapter
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
con = New SqlConnection("Data source=USER-PC\SQLEXPRESS; Initial catalog= icare; Integrated security=True")
cmd = New SqlCommand("select * from userlogin where UserName='" + TextBox1.Text + "' and Password='" + TextBox3.Text + "'", con)
SqlDataReader(dr)
con.Open()
dr = cmd.ExecuteReader()
If (dr.Read()) Then
TextBox1.Text = dr("user Name").ToString
TextBox2.Text = dr("Password").ToString
'If (TextBox1.Text = TextBox1.Text And TextBox3.Text = TextBox2.Text) Then
' Response.Redirect("Defaulft.aspx")
Else
Response.Redirect("Home.master")
lbl.Visible = True
lbl.Text = "Invalid USERNAME & PASSWORD"
End If
'End If
End Sub
结束类导入 System.Data.SqlClient 部分类登录继承 System.Web.UI.Page
Dim con As SqlConnection
Dim cmd As SqlCommand
Shared dr As SqlDataReader
'Shared da As SqlDataAdapter
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
con = New SqlConnection("Data source=USER-PC\SQLEXPRESS; Initial catalog= icare; Integrated security=True")
cmd = New SqlCommand("select * from userlogin where UserName='" + TextBox1.Text + "' and Password='" + TextBox3.Text + "'", con)
SqlDataReader(dr)
con.Open()
dr = cmd.ExecuteReader()
If (dr.Read()) Then
TextBox1.Text = dr("user Name").ToString
TextBox2.Text = dr("Password").ToString
'If (TextBox1.Text = TextBox1.Text And TextBox3.Text = TextBox2.Text) Then
' Response.Redirect("Defaulft.aspx")
Else
Response.Redirect("Home.master")
lbl.Visible = True
lbl.Text = "Invalid USERNAME & PASSWORD"
End If
'End If
End Sub
结束类导入 System.Data.SqlClient 部分类登录继承 System.Web.UI.Page
Dim con As SqlConnection
Dim cmd As SqlCommand
Shared dr As SqlDataReader
'Shared da As SqlDataAdapter
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
con = New SqlConnection("Data source=USER-PC\SQLEXPRESS; Initial catalog= icare; Integrated security=True")
cmd = New SqlCommand("select * from userlogin where UserName='" + TextBox1.Text + "' and Password='" + TextBox3.Text + "'", con)
SqlDataReader(dr)
con.Open()
dr = cmd.ExecuteReader()
If (dr.Read()) Then
TextBox1.Text = dr("user Name").ToString
TextBox2.Text = dr("Password").ToString
'If (TextBox1.Text = TextBox1.Text And TextBox3.Text = TextBox2.Text) Then
' Response.Redirect("Defaulft.aspx")
Else
Response.Redirect("Home.master")
lbl.Visible = True
lbl.Text = "Invalid USERNAME & PASSWORD"
End If
'End If
End Sub
结束类导入 System.Data.SqlClient 部分类登录继承 System.Web.UI.Page
Dim con As SqlConnection
Dim cmd As SqlCommand
Shared dr As SqlDataReader
'Shared da As SqlDataAdapter
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
con = New SqlConnection("Data source=USER-PC\SQLEXPRESS; Initial catalog= icare; Integrated security=True")
cmd = New SqlCommand("select * from userlogin where UserName='" + TextBox1.Text + "' and Password='" + TextBox3.Text + "'", con)
SqlDataReader(dr)
con.Open()
dr = cmd.ExecuteReader()
If (dr.Read()) Then
TextBox1.Text = dr("user Name").ToString
TextBox2.Text = dr("Password").ToString
'If (TextBox1.Text = TextBox1.Text And TextBox3.Text = TextBox2.Text) Then
' Response.Redirect("Defaulft.aspx")
Else
Response.Redirect("Home.master")
lbl.Visible = True
lbl.Text = "Invalid USERNAME & PASSWORD"
End If
'End If
End Sub
结束类