% Set fso = CreateObject("Scripting.FileSystemObject") Set fldr = fso.GetFolder("c:\Program Files") Response.Write "父文件夾名字是:" fldr "br>" If fldr.IsRootFolder = True Then Response.Write "該文件夾是一根文件夾" "br>" Else Response.Write "該文件夾不是根文件夾" "br>" End If Response.Write "驅(qū)動器名字是:" fldr.Drive "br>" %> |
% Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateFolder ("c:\cnbruce") Response.Write "文件夾名為" fso.GetBaseName("c:\cnbruce") %> |
% Set fso = CreateObject("Scripting.FileSystemObject") fso.DeleteFolder("c:\cnbruce") Response.Write "文件夾已刪除" %> |
% dir=server.mappath("cnbruce") Set fso = CreateObject("Scripting.FileSystemObject") if (fso.FolderExists(dir)) then fso.DeleteFolder(dir) response.write("cnbruce文件夾已經(jīng)刪除") else fso.CreateFolder(dir) response.write("cnbruce文件夾已經(jīng)建立") end if %> |
% Sub CreateAFolder(file) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateFolder(file) response.write "已經(jīng)建立了"file End Sub Sub DeleteAFolder(file) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") fso.DeleteFolder(file) response.write "已經(jīng)刪除了"file End Sub %> % subname=request.form("submit") create=request.form("create") del=request.form("del") if subname>"" then if create>"" then call CreateAFolder(""create"") end if if del>"" then call DeleteAFolder(""del"") end if end if %> form action="mainflr.asp" method="post"> input name="create"> input type="submit" value="建立" name="submit"> /form> hr> form action="mainflr.asp" method="post"> input name="del"> input type="submit" value="刪除" name="submit"> /form> |
% Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateFolder ("c:\cnbruce") fso.MoveFolder "c:\cnbruce", "C:\Program Files\" %> a href="C:\Program Files\">查看cnbruce文件夾有沒有移動過來/a> |
% Set fso = CreateObject("Scripting.FileSystemObject") fso.CopyFolder "c:\Program Files\cnbruce", "c:\" %> a href="C:\">查看cnbruce文件夾有沒有復(fù)制過來/a> |
標(biāo)簽:四平 平頂山 孝感 防城港 馬鞍山 朝陽 湖北 遼陽
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP編程入門進(jìn)階(十七):FSO組件之文件夾操作》,本文關(guān)鍵詞 ASP,編程,入門,進(jìn)階,十七,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。