Obiekt ASP shortname
![Plik Object Reference](/images/up.gif)
Shortname właściwość zwraca skróconą nazwę dla określonego pliku lub folderu (8,3 plików Naming Convention).
gramatyka
FileObject.ShortName
FolderObject.ShortName
FolderObject.ShortName
Dla obiektu wystąpienie pliku
<%
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
%>
输出:
Name: hitcounterfile.txt
ShortName: HITCOU~1.TXT
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
%>
输出:
Name: hitcounterfile.txt
ShortName: HITCOU~1.TXT
Na przykład obiekt Folder
<%
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
%>
输出:
Name: asp_test_web
ShortName: ASP_TE~1
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
%>
输出:
Name: asp_test_web
ShortName: ASP_TE~1
![Plik Object Reference](/images/up.gif)