ASP ShortPath 属性
定义和用法
ShortPath 属性用于返回指定的文件或文件夹的短路径。(8.3 文件命名约定)。
语法:
FileObject.ShortPathFolderObject.ShortPath
针对 File 对象的例子
<%dim fs,fset fs=Server.CreateObject("Scripting.FileSystemObject")set f=fs.GetFile("c:\asp_test_web\hitcounterfile.txt")Response.Write("路径: " & f.Path)Response.Write("<br />短路径: " & f.ShortPath)set f=nothingset fs=nothing%>
输出:
路径: C:\asp_test_web\hitcounterfile.txt短路径: C:\ASP_TE~1\HITCOU~1.TXT
针对 Folder 对象的例子
<%dim fs,foset fs=Server.CreateObject("Scripting.FileSystemObject")set fo=fs.GetFolder("c:\asp_test_web")Response.Write("路径: " & fo.Path)Response.Write("<br />短路径: " & fo.ShortPath)set fo=nothingset fs=nothing%>
输出:
路径: C:\asp_test_web短路径: C:\ASP_TE~1