ASP Pathプロパティ


Drive 对象参考手册Drive オブジェクトの完全なリファレンスマニュアル

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
set fs=nothing
%>

出力:

The path is 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
set fs=nothing
%>

出力:

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

Folder オブジェクトのインスタンス

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


Drive 对象参考手册Drive オブジェクトの完全なリファレンスマニュアル その他の拡張