当前位置:早雪网网络学院编程文档ASP → 解析[4] :其它的ASP常用组件

解析[4] :其它的ASP常用组件

减小字体 增大字体 作者:佚名  来源:本站原创  发布时间:2005-6-24 3:30:45
解析[4] :其它的ASP常用组件

%
Set fs = CreateObject("s cripting.FileSystemObject")
ForReading = 1
'以只读模式打开文件。不能对此文件进行写操作。
ForAppending = 8
'打开文件并在文件末尾进行写操作。
TristateUseDefault = -2
TristateTrue = -1
TristateFalse = 0

'-----------写入系统log开始--------
servermap=server.MapPath("\bbs\log\")
'映射系统物理路径
temp=servermap&"\"&year(date)&month(date)&"\"
'获取系统物理路径和时间,并以此作为log文件存放的物理路径
if Not fs.FolderExists(temp) then
fs.CreateFolder(temp)
end if
'检测是否存在文件夹,否则自动创建
dim syslog
dim tempname
tempname=date
syslog=temp&tempname&".log"
'文件名为e:\bbs\log\月份\月日.log
li=user&"&"&Now&"&"&Request.ServerVariables("REMOTE_ADDR")&"&"&tempfile&"&"&letter&"&"&title
'log文件记录的格式为:用户名&发信时间&用户ip&文件路径&信区&信件标题
if fs.FileExists(syslog) then
Set ss = fs.OpenTextFile(syslog,ForAppending,true)
else
set ss = fs.CreateTextFile(syslog,ForWriting,false)
end if
'检测log文件是否存在,如果存在则追加文件内容,反之则直接写文件
ss.WriteLine(li)
ss.Close
'-----------log文件写入结束---------
%>

[数据载入中...] [返回上一页] [打 印]