ASP取得文件的名称.路径.建立日期.文件大小.文件类型
网络 2009/5/5 22:25:17 深山行者 字体:
大 中 小 浏览 7801
<%
Dim objFSO,objFile ''声明一个名称为 objFSO 的变量以存放对象实例
Set objFSO = Server.CreateObject("scripting.FileSystemObject")
If objFSO.FileExists(Server.MapPath("news.asp")) Then
Set objFile = objFSO.GetFile(Server.MapPath("news.asp"))
Response.Write "文件的名称:"&objFile.Name&"<br>"
Response.Write "文件的路径:"&objFile.Path&"<br>"
Response.Write "文件的建立日期:"&objFile.DateCreated&"<br>"
'Response.Write "文件的最后浏览日期:"&objFile.LastAccessed&"<br>" '我测试时,这个不能显示
'Response.Write "文件的最后修改日期:"&objFile.LassModified&"<br>" '我测试时,这个不能显示
Response.Write "文件的大小:"&objFile.Size&"<br>"
Response.Write "文件的类型:"&objFile.Type&"<br>"
Else
Response.Write Server.MapPath("newfile.asp")&"不存在,无法读取相关信息"
End If
Set objFile = Nothing
Set objFSO = Nothing ''释放 FileSystemObject 对象实例内存空间
%>
- 相关阅读
- javascri获取页面实际高度
- uni-app基础知识使用hidden条件显示
- 河南中旅旅行社
- CSS编写过程中常见的10个错误
- JS代码判断集锦(之二)
- uni-app基础知识数据绑定
- 诸城市龙马假日旅行社
- 网站页面设计中的Css十大注意