<% whichfile=Server.MapPath("cnbruce.txt") Set fso = CreateObject("Scripting.FileSystemObject") Set f1 = fso.CreateTextFile(whichfile,true) f1.Write ("This is a test.My Name is cnbruce.") f1.Close Set f2 = fso.GetFile(whichfile) s = "文件名稱:" & f2.name & "<br>" s = s & "文件短路徑名:" & f2.shortPath & "<br>" s = s & "文件物理地址:" & f2.Path & "<br>" s = s & "文件屬性:" & f2.Attributes & "<br>" s = s & "文件大小: " & f2.size & "<br>" s = s & "文件類型: " & f2.type & "<br>" s = s & "文件創建時間: " & f2.DateCreated & "<br>" s = s & "最近訪問時間: " & f2.DateLastAccessed & "<br>" s = s & "最近修改時間: " & f2.DateLastModified response.write(s) %> |
Normal 0 普通文件。 沒有設置任何屬性。 ReadOnly 1 只讀文件。 可讀寫。 Hidden 2 隱藏文件。 可讀寫。 System 4 系統文件。 可讀寫。 Directory 16 文件夾或目錄。 只讀。 Archive 32 上次備份后已更改的文件。 可讀寫。 Alias 1024 鏈接或快捷方式。 只讀。 Compressed 2048 壓縮文件。 只讀。 |
<% whichfile=Server.MapPath("cnbruce.txt") Set fso = CreateObject("Scripting.FileSystemObject") Set f1 = fso.CreateTextFile(whichfile,true) f1.Write ("This is a test.My Name is cnbruce.") f1.Close Set f2 = fso.GetFile(whichfile) f2.Move "C:/" %> <a href="C:/">查看下有沒有</a> |
<% whichfile=Server.MapPath("cnbruce.txt") Set fso = CreateObject("Scripting.FileSystemObject") Set f1 = fso.CreateTextFile(whichfile,true) f1.Write ("This is a test.My Name is cnbruce.") f1.Close Set f2 = fso.GetFile(whichfile) f2.Copy "D:/" %> <a href="D:/">查看下有沒有</a> |
<% whichfile=Server.MapPath("cnbruce.txt") Set fso = CreateObject("Scripting.FileSystemObject") Set f1 = fso.CreateTextFile(whichfile,true) f1.Write ("This is a test.My Name is cnbruce.") f1.Close Set f2 = fso.GetFile(whichfile) f2.move "d:/" Set f3 = fso.GetFile("d:/cnbruce.txt") f3.delete %> <a href="d:/">查看下是沒有該文件的</a> |
新聞熱點
疑難解答