Atrybut DateLastModified w ASP
Definicja i zastosowanie
Atrybut DateLastModified służy do zwracania ostatniej daty i czasu modyfikacji określonego pliku lub katalogu.
Słowa kluczowe:
FileObject.DateLastModified FolderObject.DateLastModified
Przykład
Przykład dla obiektu File
<% zmień fs,f ustaw fs=Server.CreateObject("Scripting.FileSystemObject") ustaw f=fs.GetFile("c:\test.txt") Response.Write("File last modified on: ") Response.Write(f.DateLastModified) ustaw f=nothing ustaw fs=nothing %>
Wyjście:
File last modified on: 8/8/2008 8:8:00 PM
Przykład dla obiektu Folder
<% zmień fs,fo ustaw fs=Server.CreateObject("Scripting.FileSystemObject") ustaw fo=fs.GetFolder("c:\test") Response.Write("Folder last modified on: ") Response.Write(fo.DateLastModified) ustaw fo=nothing ustaw fs=nothing %>
Wyjście:
Folder ostatnio zmodyfikowany: 8/8/2008 8:8:00 PM