ASP ParentFolder 與 ASP Path 屬性是判斷當前檔案或檔案夾的上級目錄
我們先來看看parentfolder屬性吧.
好了下面我們接著看asp fso path 屬性執行個體教程吧.
文法
DriveObject.Path
FileObject.Path
FolderObject.Path
<%
dim fs,d
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("The path is " & d.Path)
set d=nothing
set fs=nothing
%>
Output:
The path is C:
對檔案
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:asptesttest.asp")
Response.Write("The path is: " & f.Path)
set f=nothing
set fs=nothing
%>Output:The path is: C:asptesttest.asp ParentFolder返回的路徑為指定的磁碟機,檔案或檔案夾。 該ParentFolder財產用於返回該檔案夾對象的母公司指定的檔案或檔案夾。 文法FileObject.ParentFolder FolderObject.ParentFolder 例如File對象<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:asptesttest.asp")
Response.Write("The file test.asp is in the folder: ")
Response.Write(f.ParentFolder)
set f=nothing
set fs=nothing
%>Output:The file test.asp is in the folder: C:asptestParentFolder對台戲檔案夾執行個體教程<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:asptest")
Response.Write("The folder test is in the folder: ")
Response.Write(fo.ParentFolder)
set fo=nothing
set fs=nothing
%>Output:The folder test is in the folder: C:asp