ASP取得文件的名称.路径.建立日期.文件大小.文件类型
网络 2009/5/5 22:25:17 深山行者 字体:
大 中 小 浏览 9083
<%
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 对象实例内存空间
%>
- 相关阅读
- div+css标准化在新窗口打开链接
- asp获得系统Unix时间戳与将Unix时间戳转为正常日期
- 深山留言板(激情圣诞集合五套模板)v4.4
- 在Android、iOS、Windows、MacOS中微信小程序的文件存放路径
- 深山留言板母亲节效果
- 深山行者留言系统V1.0 (简称深山留言V1.0)
- 旅行社手机网站模板5
- 深山旅行社管理系统开源吗?
- 共有0条关于《ASP取得文件的名称.路径.建立日期.文件大小.文件类型》的评论
- 发表评论