KidsLovePC Contact Us
  Home   PHP  Graphics ASP  JavaScript   J2EE  HTML  JAVA   Swing   Webtip  Forums  Lyric  Free sheet music  Ringtones

The FileSystemObject Object

The FileSystemObject will allow the programmer to

  1. Get and manipulate information about all of the drives on the server, both local and remote.
  2. Read and change information about the file system(folders, etc.)
  3. Modify information about the files in the server's file system.

The FilesSystemObject Object Properties

The FileSytemObject object has only one property, drives, which allows us to retrieve a list of all the valid drives on the Machine.

Drives: Returns a collection of Drive objects that are available from the local machine. This includes mapped network drives.

The FileSystemObject's Methods

The FileSystemObject object provides a range of methods for manipulating the subsidiary objects like Drive, Folder and File. It also provides 2 methods for working with TextStream objects: CreateTextFile and OpenTextFile.

Methods working with Drives


DriveExists(drive_path) Returns true if the drive specified in drive_path exists, or False if not.
GetDrive(drive_path) Returns a Drive object corresponding to the drive specified in drive_path.
GetDriveName(drive_path) Returns the name of the drive specified in drive_path as a string. drive_path must be an absolute path to a file or folder, or just drive letter such as "c:"

Methods for Working with Folders

BuildPath(path, name)
Adds the file or folder specified in name to the existing path, adding a path separator character ('\') if required.
CopyFolder(source,destination, overwrite)
Copies the folder or folders specified in source(wildcards can be included) to the folder destination, including all the files in source folders.
Creates a new folder which has the path and name specified in foldername. An error occurs if the specified folder already exists.
Deletes the folder or folders specified in folderspec(could include wildcards) together with all their contents
Returns True if the folder specified in folderspec exists, or false if not.
Returns an absolute full path for the folder specified by pathspec.
Returns a Folder object corresponding to the folder specified in folderspec.
Returns the name of the parent folder of the file or folder specified in pathspec.
Returns a Folder object corresponding to one of the special Windows folders. The permissible values for folderspec are WindowsFolder(0), SystemFolder(1) and TemporaryFolder(2).
Moves the folder or folders named in source to the folder named in destination.


Methods for Working with Files:

CopyFile(source, destination, overwrite)
Copies the file or files named in source to the folder named in destination. The default for overwrite is true. If overwrite is set to false and destination file already exists, an error will occur.
CreateTextFile(filename,overwrite, unicode)
Creates a new text file on disk with the specified filename, and returns a TextStream object that refers to it. The default value of overwrite is False. If unicode parameter is set to True, the content of the file will be stored as Unicode text. The default for unicode is False.
DeleteFile(filespec,force): Deletes the file or files named in filespec. IF optional force parameter is set to True, the files will be deleted even if the Read-only attribute is set. The default for force is False.
Returns true if the file specified in filespec exists, or False if not. The filespec could be an absolute or relative file path.
Returns just the name of file named in filespec, with the path and file extension removed.
Returns just the file extension of file specified in filespec
, i.e. with the path and file name removed.
Returns a File object corresponding to the file specified in filespec. This can be a relative or absolute path to the required file.
REturns the name part of the path and filename specified in pathspec, or the last folder name of there is no file name .Doesn't check for existence of the file or folder.
Returns a randomly generated file name, which can be used for performing operations that require a temporary file or folder.
Creates a file named filename, or pens an existing file named filename, and returns a TextStream object that refers to it. The filename parameter can contain an absolute or relative path. The iomode could be ForReading(1)--default), ForWriting(2), and ForAppending(8).
Moves the file or files specified in source to the folder specified in destination.


If the create is set to True when writing or appending to a file that doesn't exist, a new file will be created. The default value of create is False. The format parameters specifies the format of the data bo be read from or written to the file. Permissible values are TristateFalse(0--default) to open it a s ASCII, TristateTrue(-1) to open it as Unicode, and TristateUseDefault(-2) to open it using the system default format.

ASP tutorial
What is ASP
Install IIS
VBScript or JScript
ClientSide vs ServerSide scripting
ASP execution order
Dealing with Form
More Form example
Variable &Variant
Local variable
Global variable
Use if_then_else
Use Select Case
For_Next loop
Do_while loop
Subroutine vs Function
Request Object
Count Keyword
Using QueryString
Application, Method, Events
Create Virtual Directory
Save array in Application
Session, Method, Events
Using Cookie
Server Object
Ad Rotator
Content Linker
Dictionary object
Filesystemobject Object




Best books about ASP & ASP.Net from Amazon
Beginning Dynamic Websites : with ASP.NET Web Matrix (Programmer to Programmer) (Paperback) Build Your Own ASP.NET Website Using C# & VB.NET (Build Your Own) (Paperback) Professional Active Server Pages 3.0 (Programmer to Programmer) (Paperback) ASP.NET Cookbook (Paperback) ASP.NET Kick Start (Paperback)


Printer Inkjet A Z lyricsLearn ChineseHome|PHP|Swing|HTML|JavaScript|ASP|JAVA|Forum|WebTip|Contact Us
Copyright © All rights reserved(new). Privacy|Copyright
designed by

Please help us cover the web site maintenance fee.
barcode scanner Thermal Printer credit card machine bar code printer