Latest web development tutorials

สถานที่ให้บริการเส้นทาง ASP

ไดรฟ์อ้างอิงวัตถุ อ้างอิงวัตถุไดรฟ์ที่สมบูรณ์

สถานที่ให้บริการเส้นทางจะใช้ในการกลับไดรฟ์ที่ระบุไว้และเส้นทางของไฟล์หรือโฟลเดอร์

หมายเหตุ: สำหรับไดรฟ์เส้นทางที่ไม่ได้มีไดเรกทอรีรากยกตัวอย่างเช่นไดรฟ์ C เส้นทางคือ C: มากกว่า C: \

ไวยากรณ์

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

输出:

The path is C:

สำหรับวัตถุเช่นไฟล์

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\asp\test\test.asp")
Response.Write("The path is: " & f.Path)
set f=nothing
set fs=nothing
%>

输出:

The path is: c:\asp\test\test.asp

สำหรับวัตถุเช่นโฟลเดอร์

<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\asp\test")
Response.Write("The path is: " & fo.Path)
set fo=nothing
set fs=nothing
%>

输出:

The path is: c:\asp\test


ไดรฟ์อ้างอิงวัตถุ อ้างอิงวัตถุไดรฟ์ที่สมบูรณ์