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("c:\asp\test\test.asp")
Response.Write("The path is: " & f.Path)
set f=nothing
fs=nothing 설정
%>

출력:

경로는: C:\asp\test\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