Latest web development tutorials

ASPの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
%>

输出:

Name: hitcounterfile.txt
ShortName: HITCOU~1.TXT

インスタンス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


ファイルオブジェクト・リファレンス コンプリートファイルオブジェクトリファレンス