วิธีการ GetFileName ของ ASP
คำอธิบายและวิธีใช้
วิธีการเรียกใช้ตัวแปร GetFileName กลับค่าแบบข้อความที่มีชื่อไฟล์หรือโฟลเดอร์ของส่วนสุดท้ายของพาธที่กำหนด
คำสั่ง:
FileSystemObject.GetFileName(path)
ประกาศ | รายละเอียด |
---|---|
path | จำเป็นต้องมี。หน่วยทางที่มีเฉพาะสำหรับไฟล์หรือโฟลเดอร์ |
ตัวอย่าง
ตัวอย่าง 1
<% dim fs,p set fs=Server.CreateObject("Scripting.FileSystemObject") p=fs.getfilename("c:\test\test.htm") response.write(p) set fs=nothing %>
ออกแบบ:
test.htm
ตัวอย่าง 2
<% dim fs,p set fs=Server.CreateObject("Scripting.FileSystemObject") p=fs.getfilename("c:\test\") response.write(p) set fs=nothing %>
ออกแบบ:
test