Atrybut ShortPath w ASP

Definicja i zastosowanie

Atrybut ShortPath służy do zwracania krótkiej ścieżki do określonego pliku lub katalogu (zgodność z konwencją nazewnictwa 8.3).

Sintaksa:

FileObject.ShortPath
FolderObject.ShortPath

Przykład

Przykład dla obiektu File

<%
zmień fs,f
ustaw fs=Server.CreateObject("Scripting.FileSystemObject")
ustaw f=fs.GetFile("c:\asp_test_web\hitcounterfile.txt")
Response.Write("Ścieżka: " & f.Path)
Response.Write("<br />ShortPath: " & f.ShortPath)
ustaw f=nothing
ustaw fs=nothing
%>

Wyjście:

Ścieżka: C:\asp_test_web\hitcounterfile.txt
ShortPath: C:\ASP_TE~1\HITCOU~1.TXT

Przykład dla obiektu Folder

<%
zmień fs,fo
ustaw fs=Server.CreateObject("Scripting.FileSystemObject")
ustaw fo=fs.GetFolder("c:\asp_test_web")
Response.Write("Ścieżka: " & fo.Path)
Response.Write("<br />ShortPath: " & fo.ShortPath)
ustaw fo=nothing
ustaw fs=nothing
%>

Wyjście:

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