ASP IsRootFolder and Drive Property Example tutorial

Source: Internet
Author: User

ASP FSO IsRootFolder and Fiilesystemobject Drive properties Let's take a look at the FSO Dirve attribute usage.

The drive uses the property restitution drive in the specified file or folder.

Grammar
Fileobject.drive
Folderobject.drive

For example, a file object

<%
Dim fs,f
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set F=FS. GetFile ("C:test.txt")
Response.Write ("File resides on drive:")
Response.Write (f.drive)
Set f=nothing
Set fs=nothing
%>
Output:

File resides on Drive:c:
Folder test instance.
<%
Dim fs,fo
Set Fs=server.createobject (" Scripting.FileSystemObject ")
Set FO=FS. GetFolder ("C:test")
Response.Write ("folder resides on drive:")
Response.Write (fo. Drive)
Set fo=nothing
Set fs=nothing
%>output:folder resides on Drive:c: The following is an ASP FSO IsRootFolder to determine whether the current directory is The root directory. The IsRootFolder property returns True if the root folder of the specified folder and False if not. Syntax Folderobject.isrootfolder For example <%
Dim fs,fo
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set FO=FS. GetFolder ("C:asptest")
if fo. Isrootfolder=true then
   Response.Write ("The folder is the root folder!")
Else
   Response.Write ("The folder is not the root folder!")
End If
Set fo=nothing
Set fs=nothing
%>output:the folder isn't not the root folder!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.