如何使用MICROSOFT ACCESS和ACTIVE SERVER PAGES加密你的页面
类别: ASP教程
这是一个非常简单的加密程序,大家自己看看!
<%
userid = Request("userid")
userpass = Request("userpass")
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("userinfo.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
userid=trim(userid)
userpass=trim(userpass)
sql="select * from [userinfo]"
set Rs=Conn.execute(sql)
while not (Rs.bof or Rs.eof )
if userid=trim(Rs("用户名")) and userpass=trim(Rs("密码")) then
flag = "1"
end if
Rs.movenext()
wend
if flag = "1" then
Rs.close()
else
Rs.close()
Response.Write "<center>对不起,此用户不存在或密码不正确,请重试!</center><p align=\'center\'><a href=\'javascript:history.go(-1);\'>点这里回上一页!</a>"
Response.End
End If
conn.close
%>
<%
userid = Request("userid")
userpass = Request("userpass")
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("userinfo.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
userid=trim(userid)
userpass=trim(userpass)
sql="select * from [userinfo]"
set Rs=Conn.execute(sql)
while not (Rs.bof or Rs.eof )
if userid=trim(Rs("用户名")) and userpass=trim(Rs("密码")) then
flag = "1"
end if
Rs.movenext()
wend
if flag = "1" then
Rs.close()
else
Rs.close()
Response.Write "<center>对不起,此用户不存在或密码不正确,请重试!</center><p align=\'center\'><a href=\'javascript:history.go(-1);\'>点这里回上一页!</a>"
Response.End
End If
conn.close
%>
- 上一篇: ASP里的时间涵数
- 下一篇: 将EXCEL中的数据导入至MSSQL SERVER中
-= 资 源 教 程 =-
文 章 搜 索