asp中判斷根資料夾函式

2021-04-14 00:07:34 字數 773 閱讀 3134

如果指定的資料夾是根資料夾,返回true;否則返回false

object.isrootfolder

object應為folder物件的名稱。

說明以下**舉例說明如何使用isrootfolder屬性:

function displayleveldepth(pathspec)

dim fso, f, n

set fso = createobject("scripting.filesystemobject")

set f = fso.getfolder(pathspec)

if f.isrootfolder then

displayleveldepth ="指定的資料夾是根資料夾。"elsedo untilf.isrootfolderset f = f.parentfoldern = n + 1loopdisplayleveldepth ="指定的資料夾是巢狀級為" & n & "的資料夾。"end ifend function

asp讀取資料夾中的檔案

for each item in mydir.files 依次讀取web目錄下的每個檔案物件 dname item.path 讀取每個檔名的完整路徑和檔名 htmfile replace dname,mydir 將路完整檔案和名徑中的目錄名替換掉,保留下來的就是純檔名 response.write ...

asp建立資料夾的函式

建立資料夾的函式2 sub createfolder strfolder,ifok 首選判斷要建立的資料夾是否已經存在 dim strtestfolder,objfso if ifok then strfolder strfolder end if set objfso createobject s...

用ASP對資料夾操作

其中包括 提取資料夾資訊 建立資料夾 刪除資料夾 複製資料夾 移動資料夾等。下面就具體來看。一 fso.getfolder 一看就明白,是提取資料夾了。那具體是提取哪個資料夾呢?後面肯定要跟乙個資料夾的路徑。提取出來了再來顯示該資料夾相關資訊呢?是不是有要具體提取下去。所以,看程式 1,getfld...