如何获知文件最后的修改日期和时间?

网络编程 发布日期:2024/10/8 浏览次数:1

正在浏览:如何获知文件最后的修改日期和时间?

<%
Dim objCMFU
Dim strModified

Set objCMFU = Server.CreateObject("CM_FileUtils.GetProperty")
' 创建对象并赋给变量,并且GetProperty类是当前唯一可用的.

strModified = objCMFU.LastModified
' 检索并返回包含最后修改日期和时间(LastModified function )值.当然了,还要考虑到出错的可能.
 
Set objCMFU = Nothing
' 清空.
%>

<% If strModified = "Error!" Then %>
对不起,出错了!
<% Else %>
这个文件最后修改于:

<%= strModified %>

<%= FormatDateTime(CDate(strModified),1) %>

<%= FormatDateTime(CDate(strModified),3) %>

 

<% End If %>

 

[1]