ASP FSO: Create a file CreateTextFile instance tutorial

Source: Internet
Author: User

ASP FSO: Create a file CreateTextFile instance tutorial

The CreateTextFile method creates a new text file in the current folder and returns the TextStream object, which can be used to read or write to the file.

Grammar
Filesystemobject.createtextfile (Filename[,overwrite[,unicode]])
Folderobject.createtextfile (Filename[,overwrite[,unicode]])
 
  
  
Parameter Description
FileName Required. The name of the file to create
Overwrite
Optional A Boolean value that indicates whether existing files can be overwritten. The real indication that the file can be overwritten and falsely indicates that the file cannot be overwritten. The preset value is True
Unicode
Optional A Boolean value that indicates whether the file was created as a Unicode or ASCII file. It really points out that the file is created with a Unicode file, falsely indicating that it is creating an ASCII file. The default value is False
tutorial on file operations.
The 
 
 <% Dim fs,tfile Set Fs=server.createobject ("Scripting.FileSystemObject") set TFILE=FS. CreateTextFile ("C:somefile.txt") tfile.
WriteLine ("Hello world!") tfile.close set tfile=nothing set fs=nothing%> 
 Tutorial on folder operations. 
The
 
 <% Dim fs,fo,tfile Set Fs=server.createobject ("Scripting.FileSystemObject") set FO=FS. GetFolder ("C:test") Set Tfile=fo. CreateTextFile ("Test.txt", false) Tfile. WriteLine ("Hello world!") tfile. Close Set tfile=nothing set fo=nothing set fs=nothing%> 
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.