How to use ASP + FSO to create folders and files

Source: Internet
Author: User
Create a folder:
Set fso = CreateObject ("Scripting. FileSystemObject ")
Fso. CreateFolder ("C: \ test ")

There are three methods to create a file:

The first method is to use the CreateTextFile method.
Set fso = CreateObject ("Scripting. FileSystemObject ")
Set f1 = fso. CreateTextFile ("c: \ test.txt", True)

The second method for creating a text file is to use the OpenTextFile method of the FileSystemObject object and set the ForWriting flag.
Set fso = CreateObject ("Scripting. FileSystemObject ")
Set ts = fso. OpenTextFile ("c: \ test.txt", 2 True)

The third way to create a text file is to use the OpenAsTextStream method and set the ForWriting flag.
Set fso = CreateObject ("Scripting. FileSystemObject ")
Fso. CreateTextFile ("c: \ test1.txt ")
Set f1 = fso. GetFile ("c: \ test1.txt ")
Set ts = f1.OpenAsTextStream (2, True)

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.