ASP Path 속성

정의와 사용법

Path 속성은 지정된 드라이브, 파일 또는 폴더의 경로를 반환합니다.

문법:

DriveObject.Path 
FileObject.Path
FolderObject.Path

Drive 객체에 대한 예제

<%
dim fs,d
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("e:")
Response.Write("The path is " & d.Path)
set d=nothing
fs=nothing로 설정
%>

출력:

경로는 E:

File 객체에 대한 예제

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

출력:

경로는: C:\asp\test.asp

Folder 객체에 대한 예제

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

출력:

경로는: C:\asp\test