ASP Path అంశం

నిర్వచనం మరియు ఉపయోగం

Path అంశం నిర్దేశించిన డ్రైవర్, ఫైల్ లేదా ఫైల్ మార్గాన్ని తిరిగి ఇస్తుంది.

ప్రత్యామ్నాయం:డ్రైవర్లకు మార్గం ప్రాణికాలను చేర్చబడలేదు. ఉదాహరణకు, 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
%>

输出:

మార్గం ఉంది C:

ఫైల్ ఆబ్జెక్ట్ కోసం ఉదాహరణ

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

输出:

మార్గం ఉంది: D:\asp\test\test.asp

ఫోల్డర్ ఆబ్జెక్ట్ కోసం ఉదాహరణ

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

输出:

The path is: D:\asp\test