function WriteToFile (filename,filecontent)
Set Fso=server.createobject ("Scripting.FileSystemObject")
Set Fp=fso.createtextfile (Server.MapPath (FileName), True)
Fp.write (filecontent)
End Function
Method Two: ADODB.stream Generation file method
Set Ccobjstream = Server.CreateObject ("ADODB. Stream ")
With Ccobjstream
. Type = 2
. Mode = 3
. Open
. Charset = "Utf-8"
. Position = Ccobjstream.size
. WRITETEXT What to build
. SaveToFile to generate file paths and file names, 2
. Close
End With
CreateTextFile method
Creates a specified file and returns a TextStream object that can be used to read or write the created file.
Required option. Should be the name of the FileSystemObject or Folder object.
FileName
Required option. A string expression that indicates the file to create.
Overwrite
Options available. A Boolean value that indicates whether an existing file can be overwritten. True if the file can be overwritten, or False if the file cannot be overwritten. If this value is omitted, the existing file cannot be overwritten.
Unicode
Options available. A Boolean value that indicates whether the file is created in Unicode or ASCII file format. True If the file is created in a Unicode file format, False if the file is created in an ASCII file format. If this section is omitted, the ASCII file is assumed to be created.
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.