Atrybut ParentFolder w ASP

Definicja i użycie

Atrybut ParentFolder służy do zwracania obiektu folder dla określonego pliku lub katalogu.

Schemat:

FileObject.ParentFolder
FolderObject.ParentFolder

Przykład dla obiektu File

<%
zmień fs,f
ustaw fs=Server.CreateObject("Scripting.FileSystemObject")
ustaw f=fs.GetFile("c:\asp\test.asp")
Response.Write("Plik test.asp znajduje się w katalogu: ")
Response.Write("}}")f.ParentFolder)
ustaw f=nothing
ustaw fs=nothing
%>

Wynik:

Plik test.asp znajduje się w katalogu: C:\asp

Przykład dla obiektu Folder

<%
zmień fs,fo
ustaw fs=Server.CreateObject("Scripting.FileSystemObject")
ustaw fo=fs.GetFolder("c:\asp\test")
Response.Write("Plik test znajduje się w katalogu: ")
Response.Write("}}")fo.ParentFolder)
ustaw fo=nothing
ustaw fs=nothing
%>

Wynik:

Test folderu znajduje się w folderze: C:\asp