注册 登录
编程论坛 ASP.NET技术论坛

谁有空帮忙看个程序

spirit0904 发布于 2011-08-06 23:28, 652 次点击
这个代码是网站登录,貌似是用指纹登陆的,能不能改成直接用输入用户名和密码登陆。

<!--#include file="conn.asp"-->
<!--#include file="md5.inc"-->
<%
username = Request.Form("username")
password = Request.Form("password")
byfinger = Request.Form("byfinger")
fingertemplate = Request.Form("fingertemplate").item
if byfinger = "fingerprint" then
%>
<%
Logon
Set objRec = Nothing

Sub Logon()
    str = "SELECT * From [user]"
    Set objRec = ExecuteRs( str )

    if objRec.EOF=true and objRec.BOF=true then
        %> 对不起!当前用户不存在! 请重新输入.<%
        Exit sub
    end if
   
    fingerpass = false
    OK = 0
    if byfinger = "fingerprint" then
        Set fpProcess = Server.CreateObject("FPCom.FPProcess")
          '<!--fpProcess.Threshold = 1-100; -->
            while not objRec.eof and ok = 0
              if fpProcess.Process(objRec("fingertemplate"), fingertemplate) then
                 fingerpass = true
                 OK = objRec("id")
               end if
              objRec.movenext
            wend  
          Set fpProcess = Nothing   
        Set objRec = Nothing
    end if
    if fingerpass = true then
            str = "SELECT * From [user] where id="&OK
            Set Rs = ExecuteRs( str )

               if rs("用户类别")="超级管理员" then
                session("adminadminadmin")=true
                session("adminadmin")=true
                session("admin")=true
                session("p")=3
               else
                 if rs("用户类别")="栏目管理员" then
                   session("adminadmin")=true
                   session("admin")=true
                   p=2
               else
                   if rs("用户类别")="一般用户" then
                      session("admin")=true
                      p=1
                   end if
               end if
           end if
           session("user_name")=rs("单位")
           session("user")=rs("用户昵称")
           session("Part") = Rs("部门")
           Set Rs = Nothing
           if session("p")=3 then
           response.Redirect("adminlist.asp")
           else
           response.redirect("list.asp")
           end if
    else
    response.Redirect("index.asp")
   
    end if

end sub

%>
<% else %>
<% '登录检测
   user=trim(request.form("username"))
   password=ucase(md5(trim(request.form("password"))))
   if instr(user,"'")<>0 then m=9 end if
   if instr(user,"&")<>0 then m=9 end if
   if user<>"" and password<>"" and m<>9 then
       str="select * from [user] where 用户名='"&user&"' and 密码='"&password&"'"
       set rs = ExecuteRs(str)
       if not rs.eof then
           if rs("用户类别")="超级管理员" then
                session("adminadminadmin")=true
                session("adminadmin")=true
                session("admin")=true
                session("p")=3
           else
               if rs("用户类别")="栏目管理员" then
                   session("adminadmin")=true
                   session("admin")=true
                   p=2
               else
                   if rs("用户类别")="一般用户" then
                      session("admin")=true
                      p=1
                   else
                     
                   end if
               end if
           end if
           session("user_name")=rs("单位")
           session("user")=rs("用户昵称")
           session("Part") = Rs("部门")
           if session("p")=3 then
           response.Redirect("adminlist.asp")
           else
           response.redirect("list.asp")
           end if
       else
           response.Redirect("index.asp")
       end if
   end if
%>
<%   
 response.Redirect("index.asp")
End If %>
3 回复
#2
spirit09042011-08-06 23:29
我用admin登陆的时候显示以下情况
错误类型:
ADODB.Recordset (0x800A0CC1)
在对应所需名称或序数的集合中,未找到项目。
/processlogon.asp, 第 106 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

网页:
POST 78 ??? /processlogon.asp

POST Data:
byfinger=password&fingertemplate=&username=admin&password=123456&B1.x=0&B1.y=0
#3
spirit09042011-08-06 23:31
上面贴的那段代码就是processlogon.asp里面的全部内容。
#4
yms1232011-08-08 14:33
FPCom.FPProcess这个最有可能是指纹识别
    if byfinger = "fingerprint" then
        Set fpProcess = Server.CreateObject("FPCom.FPProcess")
          '<!--fpProcess.Threshold = 1-100; -->
            while not objRec.eof and ok = 0
              if fpProcess.Process(objRec("fingertemplate"), fingertemplate) then
                 fingerpass = true
                 OK = objRec("id")
               end if
              objRec.movenext
            wend  
          Set fpProcess = Nothing   
        Set objRec = Nothing
    end if
关键的指纹识别代码
1