ASP ขอบคุณค่า ParentFolder

การคำนิยามและวิธีใช้

ขอบคุณค่า ParentFolder ใช้เพื่อส่งกลับ folder องค์ประกอบของไฟล์หรือโฟลเดอร์ที่กำหนด

รูปแบบการใช้งาน:

FileObject.ParentFolder
FolderObject.ParentFolder

เพื่อตัวอย่าง 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
%>

การแสดงผล:

The file test.asp is in the folder: C:\asp

เพื่อตัวอย่าง 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
%>

การแสดงผล:

โฟลเดอร์ที่ทดสอบอยู่ในโฟลเดอร์: C:\asp