Properti ParentFolder ASP

Definisi dan Penggunaan

Properti ParentFolder digunakan untuk kembalikan objek folder induk dari file atau folder yang ditentukan.

Sintaks:

FileObject.ParentFolder
FolderObject.ParentFolder

contoh untuk objek File

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\asp\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

contoh untuk objek Folder

<%
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:

Test folder berada di folder: C:\asp