Skip to content
Related Articles

Related Articles

ASP DateLastAccessed Property

Improve Article
Save Article
Like Article
  • Last Updated : 31 Mar, 2021

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
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!