最新的Web开发教程
 

ASP ShortPath Property


<完整文件夹对象参考

所述ShortPath属性用于返回指定的文件或文件夹的短路径(the 8.3 naming convention)

句法

FileObject.ShortPath

FolderObject.ShortPath

例如,对于文件对象

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\asp_test_web\hitcounterfile.txt")
Response.Write("Path: " & f.Path)
Response.Write("<br>ShortPath: " & f.ShortPath)
set f=nothing
set fs=nothing
%>

Output:

Path: C:\asp_test_web\hitcounterfile.txt
ShortPath: C:\ASP_TE~1\HITCOU~1.TXT

例如,对于文件夹对象

<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\asp_test_web")
Response.Write("Path: " & fo.Path)
Response.Write("<br>ShortPath: " & fo.ShortPath)
set fo=nothing
set fs=nothing
%>

Output:

Path: C:\asp_test_web
ShortPath: C:\ASP_TE~1

<完整文件夹对象参考