CreateTextFile Examples in FSO components

Source: Internet
Author: User
FSO components of the CreateTextFile method introduced, interested in small partners can learn  

Object. CreateTextFile (filename[, overwrite[, Unicode])

  Parameter: Object

Required option. Should be the name of the FileSystemObject or Folder object.

  FileName

Required option. A string expression that indicates the file to be created.

  Overwrite

Options are available. A Boolean value that indicates whether the existing file can be overwritten. If the file can be overwritten, the value is true, otherwise false. If omitted, an existing file cannot be overwritten.

  Unicode

Options are available. A Boolean value that indicates whether the file was created in Unicode or ASCII file mode. True if the file was created as a Unicode file, or False if created as an ASCII file. If omitted, it is assumed to be an ASCII file.

Description

The following code shows how to use the CreateTextFile method to create and open a text file.

var fso = new ActiveXObject ("Scripting.FileSystemObject"); var a = fso.  CreateTextFile ("C:testfile.txt", true);  A.writeline ("This is a test."); A.close ();

If the overwrite parameter is false, or if the parameter is not provided, then an error is generated for the existing filename.

"Recommended"

1. Share an ASP CreateTextFile definition and usage

2. asp FSO: Create a file CreateTextFile instance tutorial

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.