打印

[asp] 如何记录输入的用户名和密码?

一后台login.asp
想记录每一次用户进入输入的用户名和密码,让他输入的转到一个TXT文档里或者asp文件里,自己清楚就好。要如何做?


原码如下:
免费内容:
<!-- #include file="../web.config.asp" -->
<!-- #include file="inc/function.asp" -->
<!-- #include file="inc/md5.asp" -->


<%


If Request.QueryString("Mark")="UserLogOut" then
       Session("HappyUserID")=""
       Session("HappyUserName")=""
       session("GroupID")=""
       Session("XCMS_UserID")=""
End if

If Request.QueryString("Mark")="UserLogin" then
       uChkCode=DelUrlSqlIn(Request.Form("uChkCode"))
       if uChkCode<>Session("GetCode") then Error("登陆失败:\n\n验证码错误,请返回重新输入验证码")
       
       uUserName=DelUrlSqlIn(Request.Form("uUserName"))
       uPwd=DelUrlSqlIn(Request.Form("uPwd"))
       if uUserName="" or uPwd="" then Error("登陆失败:\n\n用户名和密码都不能为空!")
       
       set tmprs = myrs("select * from Admin where Name='"& uUserName &"' and PWD='"& md5(uPwd) &"'",1,1)
       if Not(tmprs.eof and tmprs.bof) then
              Session("GroupID") = tmprs("GroupID")
              Session("XCMS_UserID") = tmprs("ID")
              call Error_go("\n欢迎进入网站管理系统\n","default.asp")
       else
              Error("用户名或密码错误")
       end if
       tmprs.close
       set tmprs=nothing
End if

%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/CssStyle.CSS" rel="stylesheet" type="text/css">


</script>
<title>管理中心</title>
</head>
<body>
<br>

<table width="600" border="0" cellpadding="3" cellspacing="0">
  <tr>
    <td align="center"><fieldset>
      <legend>登陆系统 </legend>
      <table width="98%"  border="0" align="center" cellpadding="3" cellspacing="0">
        <tr>
          <td width="4%" align="center" valign="top"> </td>
          <td width="96%" align="left" valign="top">
                <form action="?Mark=UserLogin" method="post">
                <table width="100%" border="0" cellpadding="1" cellspacing="1" class="td_lvquan">
            <tr class="btn">
              <td width="18%" align="right" >用 户 名:</td>
              <td width="82%"> 
                <input name="uUserName" type="text" style="color:#FF0000; background-color:#FFCCCC; width:200px; height:19px;" id="uUserName"></td>
              </tr>
            <tr class="btn">
              <td align="right" >密     码:</td>
              <td>                
                <input name="uPwd" style="color:#FF0000; background-color:#FFCCCC; width:200px; height:19px;" type="password" id="uPwd"></td>
              </tr>
            <tr class="btn">
              <td align="right" >验 证 码:</td>
              <td><input name="uChkCode" style="color:#FF0000; background-color:#FFCCCC; width:50px; height:19px;" type="text" id="uChkCode">                <img src="inc/ChkCode.asp"></td>
              </tr>
            <tr class="btn">
              <td align="right" > </td>
              <td>     
                <input type="submit" style="color:#FF6600; background-color:#FFCCCC;" name="Submit" value="登陆"></td>
            </tr>
            <!--tr>
              <td> </td>
              <td> </td>
              <td>添加文章 | 删除</td>
            </tr-->
          </table>
                </form>
                </td>
        </tr>
      </table>
    </fieldset></td>
  </tr>
</table>
</body>
</html>
test
使用FSO来记录登陆信息是最方便不过了。建议看下FSO的教程,搜索。
乐于助人、严格管理、言多必失。无知者无罪。Keep your waiting,I am come back.
编程资源:http://book.kuhanzhu.com
对管理有异议,请前往事物区进行投诉。请勿PM。
cookies不好吗?