我为妈妈洗脚300字:(ASP)怎样获取一个文件的信息??

来源:百度文库 编辑:高校问答 时间:2024/04/30 02:18:09
怎样获取一个文件的建立时间,修改时间,文件大小,文件类型等信息
如果形如:http://1233.com/asd.exe的路径怎么不行呀

dim myfso,myfile,mypath

mypath="C:\abc.txt" '//路径自己改
set myfso=createobject("scripting.filesystemobject")
set myfile=myfso.getfile(mypath)
response.write "建立时间:" + myfile.datecreated
response.write "修改时间:" + myfile.datelastmodified
response.write "文件大小:" + myfile.size

至于文件类型,那个自己判断一下路径的结尾的扩展名就可以了.

回答补充:
当然不行了,安全级别不能跨域访问,必须是物理路径.

如果这个1233.com网站是你自己的,你可以通过server.mappath()涵数来获得物理路径

例如: mypath=server.mappath("/asd.exe")

asd.exe需要放在你的服务器根目录下.