如何制作登陆程序?
答案:4 悬赏:50 手机版
解决时间 2021-03-12 17:50
- 提问者网友:流星是天使的眼泪
- 2021-03-12 06:26
如何制作登陆程序?
最佳答案
- 五星知识达人网友:猎心人
- 2021-03-12 06:41
用Dreamwaver MX 2004 可以制作,首先用access软件建立一个数据库表,然后表中插入两条记录,一条是用户名记录,一条是密码记录。然后在Dreamwaver MX 2004 建立后缀为.asp 的动态网页(采用asp vbscript技术),在这个动态网页添加基本的登陆界面(可参考其他登陆系统),然后进行保存。保存后把此动态页面和数据库表连接起来。然后在服务器行为面版设置登陆,注册等操作。至此登陆程序制作完毕。
Option Explicit
Dim Conn As ADODB.Connection
Dim Rs As ADODB.Recordset
Private Sub cmdOK_Click()
Rs.Open "select * from Users where Name='" & txtName.Text & "'", Conn, adOpenKeyset, adLockPessimistic
If Rs.RecordCount <= 0 Then
MsgBox "用户不存在"
Rs.Close
Exit Sub
End If
Rs.Close
Rs.Open "select * from Users where Name='" & txtName.Text & "' and Pass='" & txtPass.Text & "'", Conn, adOpenKeyset, adLockPessimistic
If Rs.RecordCount <= 0 Then
MsgBox "用户名和密码不正确"
Rs.Close
Exit Sub
End If
MsgBox "用户名和密码正确,可以登录"
Rs.Close
End Sub
Private Sub Form_Load()
Set Conn = New ADODB.Connection
Set Rs = New ADODB.Recordset
Conn.ConnectionString = "Provider=SQLOLEDB.1;Password=nndk;Persist Security Info=True;User ID=nndk;;Initial Catalog=pubsData Source=SERVER"
Conn.Open
End Sub
Option Explicit
Dim Conn As ADODB.Connection
Dim Rs As ADODB.Recordset
Private Sub cmdOK_Click()
Rs.Open "select * from Users where Name='" & txtName.Text & "'", Conn, adOpenKeyset, adLockPessimistic
If Rs.RecordCount <= 0 Then
MsgBox "用户不存在"
Rs.Close
Exit Sub
End If
Rs.Close
Rs.Open "select * from Users where Name='" & txtName.Text & "' and Pass='" & txtPass.Text & "'", Conn, adOpenKeyset, adLockPessimistic
If Rs.RecordCount <= 0 Then
MsgBox "用户名和密码不正确"
Rs.Close
Exit Sub
End If
MsgBox "用户名和密码正确,可以登录"
Rs.Close
End Sub
Private Sub Form_Load()
Set Conn = New ADODB.Connection
Set Rs = New ADODB.Recordset
Conn.ConnectionString = "Provider=SQLOLEDB.1;Password=nndk;Persist Security Info=True;User ID=nndk;;Initial Catalog=pubsData Source=SERVER"
Conn.Open
End Sub
全部回答
- 1楼网友:患得患失的劫
- 2021-03-12 08:03
用Dreamwaver MX 2004 可以制作,首先用access软件建立一个数据库表,然后表中插入两条记录,一条是用户名记录,一条是密码记录。然后在Dreamwaver MX 2004 建立后缀为.asp 的动态网页(采用asp vbscript技术),在这个动态网页添加基本的登陆界面(可参考其他登陆系统),然后进行保存。保存后把此动态页面和数据库表连接起来。然后在服务器行为面版设置登陆,注册等操作。至此登陆程序制作完毕。
- 2楼网友:你哪知我潦倒为你
- 2021-03-12 07:26
Option Explicit
Dim Conn As ADODB.Connection
Dim Rs As ADODB.Recordset
Private Sub cmdOK_Click()
Rs.Open "select * from Users where Name='" & txtName.Text & "'", Conn, adOpenKeyset, adLockPessimistic
If Rs.RecordCount <= 0 Then
MsgBox "用户不存在"
Rs.Close
Exit Sub
End If
Rs.Close
Rs.Open "select * from Users where Name='" & txtName.Text & "' and Pass='" & txtPass.Text & "'", Conn, adOpenKeyset, adLockPessimistic
If Rs.RecordCount <= 0 Then
MsgBox "用户名和密码不正确"
Rs.Close
Exit Sub
End If
MsgBox "用户名和密码正确,可以登录"
Rs.Close
End Sub
Private Sub Form_Load()
Set Conn = New ADODB.Connection
Set Rs = New ADODB.Recordset
Conn.ConnectionString = "Provider=SQLOLEDB.1;Password=nndk;Persist Security Info=True;User ID=nndk;;Initial Catalog=pubsData Source=SERVER"
Conn.Open
End Sub
Dim Conn As ADODB.Connection
Dim Rs As ADODB.Recordset
Private Sub cmdOK_Click()
Rs.Open "select * from Users where Name='" & txtName.Text & "'", Conn, adOpenKeyset, adLockPessimistic
If Rs.RecordCount <= 0 Then
MsgBox "用户不存在"
Rs.Close
Exit Sub
End If
Rs.Close
Rs.Open "select * from Users where Name='" & txtName.Text & "' and Pass='" & txtPass.Text & "'", Conn, adOpenKeyset, adLockPessimistic
If Rs.RecordCount <= 0 Then
MsgBox "用户名和密码不正确"
Rs.Close
Exit Sub
End If
MsgBox "用户名和密码正确,可以登录"
Rs.Close
End Sub
Private Sub Form_Load()
Set Conn = New ADODB.Connection
Set Rs = New ADODB.Recordset
Conn.ConnectionString = "Provider=SQLOLEDB.1;Password=nndk;Persist Security Info=True;User ID=nndk;;Initial Catalog=pubsData Source=SERVER"
Conn.Open
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯