ASP ShortName Property
คำนำออกและการใช้งาน
ShortName Property ใช้เพื่อกลับค่าชื่อย่อของแฟ้มหรือโฟลเดอร์ที่กำหนด (8.3 Naming Convention).
รูปแบบการใช้งาน
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