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

最新下载

热门教程

ASP ParentFolder 与 ASP Path 属性实例教程

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

ASP ParentFolder 与 ASP Path 属性是判断当前文件或文件夹的上级目录

我们先来看看parentfolder属性吧.

好了下面我们接着看asp fso path 属性实例教程吧.

语法
DriveObject.Path
FileObject.Path

FolderObject.Path

<%
dim fs,d
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("The path is " & d.Path)
set d=nothing
set fs=nothing
%>
Output:

The path is C:
对文件
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:asptesttest.asp")
Response.Write("The path is: " & f.Path)
set f=nothing
set fs=nothing
%>Output:The path is: C:asptesttest.asp  ParentFolder返回的路径为指定的驱动器,文件或文件夹。  该ParentFolder财产用于返回该文件夹对象的母公司指定的文件或文件夹。 语法FileObject.ParentFolder FolderObject.ParentFolder  例如File对象<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:asptesttest.asp")
Response.Write("The file test.asp is in the folder: ")
Response.Write(f.ParentFolder)
set f=nothing
set fs=nothing
%>Output:The file test.asp is in the folder: C:asptestParentFolder对台戏文件夹实例教程<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:asptest")
Response.Write("The folder test is in the folder: ")
Response.Write(fo.ParentFolder)
set fo=nothing
set fs=nothing
%>Output:The folder test is in the folder: C:asp

热门栏目