ASP ShortName 與 ShortPath屬性是取得檔案短名或路徑的
該ShortPath財產用于歸還短路徑指定的檔案或檔案夾( 8.3命名規範) 。
文法
FileObject.ShortPath
FolderObject.ShortPath
例如File對象
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:asp_test_webhitcounterfile.txt")
Response.Write("Path: " & f.Path)
Response.Write("<br />ShortPath: " & f.ShortPath)
set f=nothing
set fs=nothing
%>
Output:
Path: C:asp_test_webhitcounterfile.txt
ShortPath: C:ASP_TE~1HITCOU~1.TXT
對檔案夾操作一樣的.下面來看看asp filesystemobject ShortName 屬性吧.
該ShortName用于歸還簡短名稱指定的檔案或檔案夾( 8.3命名規範) 。
文法
FileObject.ShortName
FolderObject.ShortName
例如File對象
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:hitcounterfile.txt"))
Response.Write("Name: " & f.Name)
Response.Write("<br />ShortName: " & f.ShortName)
set f=nothing
set fs=nothing
%>
Output:
Name: hitcounterfile.txt
ShortName: HITCOU~1.TXT
fso ShortName 屬性 下面對檔案夾執行個體教程
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:asp_test_web")
Response.Write("Name: " & fo.Name)
Response.Write("<br />ShortName: " & fo.ShortName)
set fo=nothing
set fs=nothing
%>Output:Name: asp_test_web
ShortName: ASP_TE~1