Open In App

ASP DateLastAccessed Property

Last Updated : 31 Mar, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

The ASP DateLastAccessed Property is used to get the date and time when the particular file or folder is last access on the system.

Syntax:

  • For file Object:
FileObject.DateLastAccessed
  • For folder Object:
FolderObject.DateLastAccessed

Example-1: Below code demonstrates the ASP FileObjectDateLastAccessed Property

ASP




<%
dim fs,gfg
set fs=Server.CreateObject("Scripting.FileSystemObject")
set gfg=fs.GetFile("d:\GFG.txt")
Response.Write("File last accessed on: ")
Response.Write(gfg.DateLastAccessed)
set gfg=nothing
set fs=nothing
%>


Output:

File last accessed on: 12/29/2020 11:21:10 AM

Example-2: Below code demonstrates the ASP FolderObjectDateLastAccessed Property

ASP




<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("d:\GFG")
Response.Write("Folder last accessed on: ")
Response.Write(fo.DateLastAccessed)
set fo=nothing
set fs=noQthing
%>


Output:

Folder last accessed on: 12/29/2020 11:21:10 AM

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads