首先。你关闭页面就不好关。。 如果这个页面是你自己调去。不能有滚动条。菜单栏如果有。他会提示你关闭select * from where user="" && pwd=""获取返影响的行数 cmd.ExecuteScalar() 为1 就是正确
Imports System.Data Imports System.Data.SqlClientPartial Class _Default Inherits System.Web.UI.Page Protected Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click Dim conn As New SqlConnection("Data Source='F:\shujuku';Initial Catalog='t_o_data.mdf';Persist Security Info=True;User ID='sa';Password=''") Dim cmd As New SqlCommand("select * form users where user_name='admin' && pas_char='123',conn") conn.Open() Dim dr As SqlDataAdapter = cmd.ExecuteScalar() If cmd.ExecuteScalar() = 1 Then Response.Redirect("1.jpg") Else Response.Redirect("11.jpg") End If conn.Close() End Sub End Class 这时 登录 的Click事件的代码,提示加粗的地方出错看看是为什么
Dim conn As New SqlConnection("Data Source='F:\shujuku';Initial Catalog='t_o_data.mdf';Persist Security Info=True;User ID='sa';Password=''") 定义了啊
这个超简单的,就不用他们帮忙了。
{
Response.Redirect("路径")
}
else
{
lblmessage.text="<script>alert('帐号或密码错误');</script>";
}
http://opou.download.csdn.net/
中的MMS系统
如果这个页面是你自己调去。不能有滚动条。菜单栏如果有。他会提示你关闭select * from where user="" && pwd=""获取返影响的行数 cmd.ExecuteScalar() 为1 就是正确
Imports System.Data.SqlClientPartial Class _Default
Inherits System.Web.UI.Page
Protected Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
Dim conn As New SqlConnection("Data Source='F:\shujuku';Initial Catalog='t_o_data.mdf';Persist Security Info=True;User ID='sa';Password=''")
Dim cmd As New SqlCommand("select * form users where user_name='admin' && pas_char='123',conn")
conn.Open()
Dim dr As SqlDataAdapter = cmd.ExecuteScalar()
If cmd.ExecuteScalar() = 1 Then
Response.Redirect("1.jpg")
Else
Response.Redirect("11.jpg")
End If
conn.Close()
End Sub
End Class
这时 登录 的Click事件的代码,提示加粗的地方出错看看是为什么
定义了啊