ASP Path 속성

정의와 사용법

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

비고:드라이브의 경우, 경로에는 루트 디렉토리가 포함되지 않습니다. 예를 들어, C 드라이브의 경로는 C:입니다. C:\가 아니라요.

문법:

DriveObject.Path 
FileObject.Path
FolderObject.Path

예제

Drive 객체에 대한 예제

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

출력:

경로는 C:

File 객체에 대한 예제

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

출력:

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

Folder 객체에 대한 예제

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

출력:

경로는: D:\asp\test