日期:2014-05-17 浏览次数:20860 次
<% if request.cookies("name")<>""then '判断cookies是否为空,不为空就直接登录 dwg=cstr(request.cookies("name")) sql2="select * from admin where 用户名='"&dwg&"'" set rs2=server.CreateObject("adodb.recordset") rs2.open sql2,MM_conngongsi_STRING,1,3 if rs2.eof then '判断有无记录,如果没有记录就清空客户端cookies.有记录就自动登录 response.cookies("name")="" response.cookies("pass")="" response.Redirect "admin_longin.asp" response.end else sql3="select MD5 from admin where 用户名='"&dwg&"'" set rs3=server.CreateObject("adodb.recordset") rs3.open sql3,MM_conngongsi_STRING,1,3 if request.cookies("pass")=rs3("MD5") then '判断密码是否正确 Session("MM_Username")=cstr(request.cookies("name")) response.redirect "admin.asp" response.End else response.cookies("name")="" response.cookies("pass")="" response.Redirect "admin_longin.asp" response.end end if end if end if %>