一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

ASP ShortName 与 ShortPath属性实例教程

时间:2008-11-04 编辑:简简单单 来源:一聚教程网

ASP ShortName  与 ShortPath属性是取得文件短名或路径的

该ShortPath财产用于归还短路径指定的文件或文件夹( 8.3命名约定) 。

语法
FileObject.ShortPath
FolderObject.ShortPath
 

例如File对象

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:asp_test_webhitcounterfile.txt")
Response.Write("Path: " & f.Path)
Response.Write("
ShortPath: " & f.ShortPath)
set f=nothing
set fs=nothing
%>
Output:
Path: C:asp_test_webhitcounterfile.txt
ShortPath: C:ASP_TE~1HITCOU~1.TXT
 


对文件夹操作一样的.下面来看看asp filesystemobject ShortName 属性吧.

该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("
ShortName: " & f.ShortName)
set f=nothing
set fs=nothing
%>
Output:

Name: hitcounterfile.txt
ShortName: HITCOU~1.TXT
fso ShortName 属性 下面对文件夹实例教程
<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:asp_test_web")
Response.Write("Name: " & fo.Name)
Response.Write("
ShortName: " & fo.ShortName)
set fo=nothing
set fs=nothing
%>Output:Name: asp_test_web
ShortName: ASP_TE~1

热门栏目