The magic of the FSO in ASP-FSO can not do

Source: Internet
Author: User
FSO Author: Gan Ganping;


The FSO does have some weaknesses-for example, it's hard to handle binaries, including Word documents, many graphics-formatted files, and other files. However, you can still manipulate these files in other ways-move them, delete them, and so on. What you can't do is open or write them.

Another limitation is the question of file length. When read and write immediately, all information is stored in memory-the more content, the greater the memory consumed. This will make every job slow. So, if you need to operate a very large file, or a large number of small files, consider splitting the file into small chunks, and often clears the memory. Incorporating the application into the COM object component can also greatly increase the speed of the program.

Also, you cannot use the FSO to manage permissions and the properties of files and folders, and a good way to perform security encryption is to set the guest book file mentioned previously as read-only, set to writable when needed, and then modify it back. This method is often used in CGI and Perl, but unfortunately there is no satisfactory way to implement it with the FSO.

What else can I do with the FSO?

There are many great features in the FSO, but many people don't realize it. These features are often found when you feel it's hard to do something, and you often have to sigh, "if only I had known this method!"

Here are some of the less common but very cool features:

FSO features that are rarely understood
GetSpecialFolder method returns the path to a specific Windows folder: Windows installation directory; Windows system directory; Windows Temp directory FSO. GetSpecialFolder ([0, 1, or 2])
GetTempName method returns a randomly generated file or directory name that is used to store temporary data
Getabsolutepathname method returns the absolute path of the folder (similar to Server.MapPath).
For example, FSO. Getabsolutepathname ("region") returns a result similar to the following: "C:mydocsmyfolder egion"
Getextensionname method returns the extension of the last part of the path
(For example: Fso.getextensionname ("C:docs est.txt") will return txt)
Getbasename and Getparentfolder Methods returns the parent folder of the last part of the path
(For example: Fso.getparentfolder ("C:docsmydocs") will return to ' docs ')
The Drives property returns a collection of all locally available drives to establish a resource-browser-like user interface.

When using the above features, it is best to create a good error-handling code. Because if the required parameters do not exist, you will have trouble with the information.

Summarize

As we can see, the FSO is very useful, and this is just the tip of the iceberg. You can use the FSO to build powerful applications that simply accomplish a number of tasks.



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.