ASP 3.0 Advanced Programming (20)

Source: Internet
Author: User
5.4.1 FileSystemObject Object Member Overview
The FileSystemObject object provides a property and a series of methods that can be used to manipulate some subordinate objects implemented by the FileSystemObject object. This provides a complete overview of the content and then describes each subordinate object.
1. Properties of FileSystemObject
The FileSystemObject object has only one property, which is used to get a list of all the valid drives on the current machine, as shown in table 5-4:
Table 5-4 Properties and descriptions of FileSystemObject objects
Property
Description
Drivers
Returns the list of drives available for the local computer.
2. The method of FileSystemObject
The FileSystemObject object provides a series of methods for using dependent objects, including objects such as drive, folder, and file. It also implements two methods for TextStream objects: CreateTextFile and OpenTextFile. The method is divided into three classes, depending on the type of object being used.
(1) The method associated with the drive
The drive-related methods are shown in table 5-5:
Table 5-5 methods and instructions related to drives
Method
Description
Driveexists (DRIVESPEC)
Returns true if the drive specified in Drivespec exists, otherwise returns false. The Drivespec parameter can be a drive letter, or a full absolute path to a file or folder
Getdrive (DRIVESPEC)
Returns the drive object that corresponds to the drive specified by Drivespec. Drivespec can contain a colon, a path separator, or a network share name, namely: "C", "C:", "C:" and "Machinesharename"
GetDriveName (DRIVESPEC)
Returns the name of the drive specified by the Drivespec with a string. The Drivespec parameter must be an absolute path to a file or folder, or just a drive letter, such as: "C:" or "C"
(2) Folder-related methods
The folder-related methods are shown in table 5-6:
Table 5-6 methods and descriptions related to folders
Method
Description
BuildPath (Path,name)
Add the file or folder named name to the path path you already have, and add the path separator if needed.
CopyFolder (Source,destination,overwrite)
Copies one or more folders from the specified source folder, which can contain wildcards, to the specified destination folder destination, including all files in the source folder. If source contains wildcard characters or the destination end is a path delimiter ('), the destination is considered to be the folder where you want to place the copy of the source folder. Otherwise, consider destination to be the pathname of the new folder you want to create. If the destination folder already exists and the overwrite parameter is set to False, an error occurs and the default overwrite parameter is True
CreateFolder (FolderName)
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.