Thuộc tính ASP ParentFolder
❮ Toàn bộ tham chiếu đối tượng thư mục
Thuộc tính ParentFolder được sử dụng để trả về đối tượng thư mục cho tệp hoặc thư mục gốc của tệp hoặc thư mục được chỉ định.
Cú pháp
FileObject.ParentFolder
FolderObject.ParentFolder
Ví dụ cho đối tượng Tệp
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\asp\test\test.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:\asp\test
Ví dụ cho đối tượng Thư mục
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\asp\test")
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
❮ Toàn bộ tham chiếu đối tượng thư mục