大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
哈哈简单哪
成都创新互联公司-专业网站定制、快速模板网站建设、高性价比普兰网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式普兰网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖普兰地区。费用合理售后完善,十载实体公司更值得信赖。
第一步:登陆网页代码
第二步:登陆以后判断是否登陆成功
有两种方法: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