📄 login.asp
字号:
<!--#include file="Include/ADOdata.asp" -->
<%
Dim strUserName 'As String
Dim strPassword 'As String
Dim strUserID ' As String
Dim objSecurity
'清除现存cookies
Response.Cookies("userauthid")= ""
strUserName = Request.Form("txtUserName")
strPassword = Request.Form("txtPassword")
strUserID = GetUserID(strUserName, strPassword)
If strUserID= "invalid" Then
'如果资料错误-重新回登录画面
Response.Write "<H2>登录确认错误</H2>"
Response.Write "请再试一次."
Server.transfer "login.htm"
Else
'将UserID写入cookie.并执行main.asp
Response.Cookies("userauthid")= strUserID
server.execute "main.asp"
End If
Function GetUserID(strUserName, strPassword)
'检查会员资料并返回user ID
Dim cmd
Dim conDB
Dim strUserID
'初始化strUserID
strUserID = "invalid"
'检查输入资料,无错误执行getuserid stored procedure
If ValidData(strUserName, strPassword) Then
Set cmd = CreateObject("ADODB.Command")
With cmd
.ActiveConnection = strCon
.CommandText = "getuserid"
.CommandType = adCmdStoredProc
.Parameters(1).Value = strUserName
.Parameters(2).Value = strPassword
.Execute
End With
'检查返回的user id
If Not IsNull(cmd.Parameters(3).Value) Then
strUserID = cmd.Parameters(3).Value
End If
End If
GetUserID = strUserID
Set cmd = Nothing
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -