ASP ParentFolder 與 ASP Path 屬性執行個體教程

來源:互聯網
上載者:User

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.