Author: Gan jiping;
Source: http://www.15seconds.com/Issue/000816.htm
In ASP, FSO indicates a File System Object, that is, a File System Object.
The computer file system we want to manipulate is located on the web server. So confirm that you have the appropriate permissions. Ideally, you can create a web server on your own machine to facilitate testing. If you are running on Windows, try Microsoft's free personal Web Server PWS.
FSO model object
Drive Object: Drive Object for disk access or network Drive
FileSystemObject Object: File System Object for accessing the computer's File System
Folder Object: all attributes of a Folder Object for access
TextStream Object: Text Stream Object for accessing File Content
You can use the above objects to do anything on the computer, including destructive activities;-(so please be careful when using FSO. In the web environment, storing information is very important, such as user information, log files, and so on. FSO provides a powerful and simple way to efficiently store data. In this article, we will focus on FileSystemObject and TextStream objects.
FSO is supported by Microsoft and cannot be used for non-Windows systems.
How to Use FSO?
To use FSO to execute all the work, you must first create an object. The Code is as follows:
<%
Set fso = Server. CreateObject ("Scripting. FileSystemObject ")
%>
In this way, the FSO is created and the variable fso is assigned, and then the familiar object can be used. method syntax to perform operations on the file system (view the Visual Basic documentation to learn more about object and object wizard programming 〕. Here, we can use fso. method or fso. property, which will be seen in the following example.
The FSO model is located in the script run time DLL file provided by Microsoft. It is scrrun. dll. You can reference this DLL file in any application, such as MS Access and Word. That is to say, it is not limited to be applied in ASP.
Here is a brief list of FSO methods:
FSO Method
CopyFile: copy one or more files to the new path.
CreateTextFile: Creates a file and returns a TextStream object.
DeleteFile: delete an object
OpenTextFile open the file and return the TextStream object for reading or appending
For more information about FSO methods and attributes, see Microsoft MSDN. Here are several examples.