如何获知文件被改动的情况?
发布时间:2016-12-29 来源:查字典编辑
摘要:FunctionFile_GetLastModified(sFile)DimobjFileObj,objFileSetobjFileObj=...
Function File_GetLastModified( sFile )
Dim objFileObj, objFile
Set objFileObj = CreateObject("Scripting.FileSystemObject")
If sFile = "" Then
sFile = Server.MapPath( Request.ServerVariables
("script_NAME") )
End If
Set objFile = objFileObj.GetFile(sFile)
File_GetLastModified = objFile.DateLastModified
End Function
Response.Write "记录文件被修改:" & File_GetLastModified
("d:shenzhaoyangrecord.txt")
Response.Write "糟了,这个文件已被修改过!" & File_GetLastModified("")
[1]