Date last accessed

This snippet shows how to display when a file was last accessed .

<%
'declare our variables
Dim objFSO , myFile
'create instances of the objects
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set myFile = objFSO.GetFile(Server.MapPath("sample.txt"))
'display information
Response.Write "The file was last accessed on " & myFile.DateLastAccessed
'delete our object variables
Set objFSO = Nothing
Set myFile = nothing
%>

Which in this example would give us the following results.

 

Sponsors