ASP ShortPath 屬性
asp shortpath 屬性

shortpath 屬性用于返回指定文件或文件夾的短路徑(8.3 文件命名公約)。
語法
fileobject.shortpath
folderobject.shortpath
folderobject.shortpath
針對 file 對象的實例
<%
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("
shortpath: " & f.shortpath)
set f=nothing
set fs=nothing
%>
輸出:
path: c:\asp_test_web\hitcounterfile.txt
shortpath: c:\asp_te~1\hitcou~1.txt
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("
shortpath: " & f.shortpath)
set f=nothing
set fs=nothing
%>
輸出:
path: c:\asp_test_web\hitcounterfile.txt
shortpath: c:\asp_te~1\hitcou~1.txt
針對 folder 對象的實例
<%
dim fs,fo
set fs=server.createobject("scripting.filesystemobject")
set fo=fs.getfolder("c:\asp_test_web")
response.write("path: " & fo.path)
response.write("
shortpath: " & fo.shortpath)
set fo=nothing
set fs=nothing
%>
輸出:
path: c:\asp_test_web
shortpath: c:\asp_te~1
dim fs,fo
set fs=server.createobject("scripting.filesystemobject")
set fo=fs.getfolder("c:\asp_test_web")
response.write("path: " & fo.path)
response.write("
shortpath: " & fo.shortpath)
set fo=nothing
set fs=nothing
%>
輸出:
path: c:\asp_test_web
shortpath: c:\asp_te~1

相關(guān)文章
- ASP Content Linking
- ASP Content Rotator
- ASP – AJAX 與 ASP
- ASP 語法
- ASP Close 方法
- ASP Write 方法
- ASP DateCreated 屬性
- ASP Key 屬性
- ASP Add 方法
- ASP RemoveAll 方法
- ASP Cookies 集合
- ASP Expires 屬性
- ASP Status 屬性
- ASP Flush 方法
- ASP Contents 集合
- ASP Application_OnStart 和 Application_OnEnd 事件
- ASP SessionID 屬性
- ASP CreateObject 方法
- ASP Drives 屬性
- ASP FileExists 方法