ASP取得文件的名稱.路徑.建立日期.文件大小.文件類型
網(wǎng)絡(luò) 2009/5/5 22:25:17 深山行者 字體:
大 中 小 瀏覽 8989
<%
Dim objFSO,objFile ''聲明一個(gè)名稱為 objFSO 的變量以存放對(duì)象實(shí)例
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>" '我測試時(shí),這個(gè)不能顯示
'Response.Write "文件的最后修改日期:"&objFile.LassModified&"<br>" '我測試時(shí),這個(gè)不能顯示
Response.Write "文件的大小:"&objFile.Size&"<br>"
Response.Write "文件的類型:"&objFile.Type&"<br>"
Else
Response.Write Server.MapPath("newfile.asp")&"不存在,無法讀取相關(guān)信息"
End If
Set objFile = Nothing
Set objFSO = Nothing ''釋放 FileSystemObject 對(duì)象實(shí)例內(nèi)存空間
%>
- 相關(guān)閱讀
- asp利文本文檔加FSO統(tǒng)計(jì)網(wǎng)站訪問量的方法(2)
- 內(nèi)蒙古香格里拉旅行社有限公司
- FLASH中加入LOADING的最簡便方法
- 利用background-color:#000000a8在背景顏色16進(jìn)制代碼之后加字母加上數(shù)字讓背景色透明
- 紹興中僑旅游網(wǎng)
- 圖片上傳時(shí),如果格式不正確,跳出警告
- 性感的CSS菜單(Menus)
- CSS選擇符詳解
- 共有0條關(guān)于《ASP取得文件的名稱.路徑.建立日期.文件大小.文件類型》的評(píng)論
- 發(fā)表評(píng)論