這是一個非常簡單的加密程序,大家自己看看!
<%
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