一个文件的属性在ASP中是可读的,也是能显示的。这对你的文档不断的更新和你想他们最后修改在网页显示的日期是很有用的。任何的属性是由右边的鼠标点击一个选项是很有用的和在PC上显示的属性对于下面列举的方法是有用的。
<%
location = request.servervariables("appl_physical_path") + "\asp\file_spec.asp"
set fso = createobject("scripting.filesystemobject")
set file_attrib = fso.getfile(location)
%>
<b>Modified</b>
<br>
<%= file_attrib.datelastmodified %>
<%= file_attrib.datelastmodified %>
<br>
<%= datevalue(file_attrib.datelastmodified) %>
<%=datevalue(file_attrib.datelastmodified) %>
<br>
<b>Created</b>
<br>
<%= file_attrib.datecreated %>
<%= file_attrib.datecreated %>
<br>
<%= datevalue(file_attrib.datecreated) %>
<%=datevalue(file_attrib.datecreated) %>
<br>
<b>Size</b>
<br>
<%= file_attrib.size %>
<%= file_attrib.size %> bytes
<br>
<%= file_attrib.size/1024 %>
<%= file_attrib.size/1024 %> kb
<br>
<b>Type</b>
<br>
<%= file_attrib.type %>
<%= file_attrib.type %>
<br>
<b>Name</b>
<br>
<%= file_attrib.name %>
<%
location = request.servervariables("appl_physical_path") + "\asp\file_spec.asp"
set fso = createobject("scripting.filesystemobject")
set file_attrib = fso.getfile(location)
%>
<b>Modified</b>
<br>
<%= file_attrib.datelastmodified %>
<%= file_attrib.datelastmodified %>
<br>
<%= datevalue(file_attrib.datelastmodified) %>
<%=datevalue(file_attrib.datelastmodified) %>
<br>
<b>Created</b>
<br>
<%= file_attrib.datecreated %>
<%= file_attrib.datecreated %>
<br>
<%= datevalue(file_attrib.datecreated) %>
<%=datevalue(file_attrib.datecreated) %>
<br>
<b>Size</b>
<br>
<%= file_attrib.size %>
<%= file_attrib.size %> bytes
<br>
<%= file_attrib.size/1024 %>
<%= file_attrib.size/1024 %> kb
<br>
<b>Type</b>
<br>
<%= file_attrib.type %>
<%= file_attrib.type %>
<br>
<b>Name</b>
<br>
<%= file_attrib.name %>
<%= file_attrib.name %>
简单生活,希望对大家有用!要觉得本文有价值请分享给您的朋友,生活就是人来人往,分享越多!收获越多!作者:天天ASP家园