Atrybut DateCreated w ASP
Definicja i użycie
Atrybut DateCreated służy do zwracania daty i czasu utworzenia określonego pliku lub folderu.
Sintaksa:
FileObject.DateCreated FolderObject.DateCreated
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("Plik utworzony: ") Response.Write(f.DateCreated) ustaw f=nothing ustaw fs=nothing %>
Wyjście:
Plik utworzony: 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 created: ") Response.Write(fo.DateCreated) ustaw fo=nothing ustaw fs=nothing %>
Wyjście:
Folder utworzony: 8/8/2008 8:8:00 PM