📜  ASP DateLastAccessed 属性

📅  最后修改于: 2022-05-13 01:56:45.832000             🧑  作者: Mango

ASP DateLastAccessed 属性

ASP DateLastAccessed 属性用于获取特定文件或文件夹最后一次访问系统的日期和时间。

句法:

  • 对于文件对象:
FileObject.DateLastAccessed
  • 对于文件夹对象:
FolderObject.DateLastAccessed

示例 1 :下面的代码演示了ASP FileObjectDateLastAccessed属性

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
%>


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
%>


输出:

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

示例 2 :下面的代码演示了 A SP FolderObjectDateLastAccessed属性

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
%>

输出:

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