28,390
社区成员
发帖
与我相关
我的任务
分享
Function readtxtfile(fname)
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim filestr
filename=server.mappath(fname)
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filename)
Set readf = f.OpenAsTextStream(1,0)
filestr = filestr & readf.ReadLine & chr(13) & chr(10)
do while not readf.atendofstream
filestr = filestr & readf.ReadLine & chr(13) & chr(10)
Loop
readf.close
readtxtfile = filestr
End Function
Function MakeStrFile(Str,Url)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath(Url))
fout.Write Str
fout.close
set fout=nothing
set fso=nothing
MakeStrFile = true
End Function
Sub SetIISinfo(NewIISstr)
iisStr = readtxtfile("iis.txt")
iisStr = iisStr & Chr(13) & Chr(10) & NewIISstr
t = MakeStrfile(iisStr,"iis.txt")
end Sub
sub application_onstart
application("thetime")=now()
SetIISinfo(now())
end sub