重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
哈哈简单哪
创新互联服务电话:028-86922220,为您提供成都网站建设网页设计及定制高端网站建设服务,创新互联网页制作领域十余年,包括成都边坡防护网等多个方面拥有丰富的网站制作经验,选择创新互联,为企业锦上添花!
第一步:登陆网页代码
第二步:登陆以后判断是否登陆成功
有两种方法:1.获取网页代码,判断网页字符有无”登陆成功”字样
源代码:
2.就是判断网页是否跳转到了某一页
源代码:
两种方法结合起来用,可以判断网页是否无法连接
首先要把Label1的属性Visible设置为false,然后双击button1输入:
Dim rs As New Data.DataView()
Dim rs As New DataView()
conn.DataFile = "users.mdb"
conn.SelectCommand = "select top 1 * from users where name='" txtUserName.Text "'and pass='" txtPassword.Text "'"
rs = conn.Select(DataSourceSelectArguments.Empty)
if rs.Count Then
Label1.Visible=true
Session("name") = Trim(txtUserName.Text)
Session("pass") = Trim( txtPassword.Text)
MsgBox("登录成功", MsgBoxStyle.SystemModal)
Response.Redirect("")
Else
MsgBox("对不起!用户名和密码不正确,请重新输入。", MsgBoxStyle.SystemModal)
End If
Private Sub BtOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Btok.Click
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Admin.accdb;Persist Security Info=True")
Dim com As OleDbCommand = New OleDbCommand("select * from 用户名", con)
con.Open()
Dim h1 As OleDbDataReader
Dim table As New DataTable
h1 = com.ExecuteReader()
table.Load(h1)
If txtName.Text = "" Then
MsgBox("请输入用户名", MsgBoxStyle.OkCancel + MsgBoxStyle.Exclamation, "错误提示")
ElseIf txtName.Text "" And txtPasswd.Text = "" Then
MsgBox("请输入密码", MsgBoxStyle.OkCancel + MsgBoxStyle.Exclamation, "错误提示")
ElseIf table.Select("用户名='" txtName.Text "'").Length 0 Then
If table.Select("用户名='" txtName.Text "'")(0)("密码").ToString = txtPasswd.Text Then
MsgBox("成功登陆", MsgBoxStyle.OkCancel + MsgBoxStyle.Exclamation, "错误提示") Then
Form1.Show()
Me.Visible = False
Exit Sub
Else
MsgBox("密码错误", MsgBoxStyle.OkCancel + MsgBoxStyle.Exclamation, "错误提示")
End If
Else
MsgBox("用户名不存在", MsgBoxStyle.OkCancel + MsgBoxStyle.Exclamation, "错误提示")
Exit Sub
End If
table.Clear()
h1.Close()
con.Close()
End Sub