Home > Backend Development > C#.Net Tutorial > asp fso: create file CreateTextFile example tutorial

asp fso: create file CreateTextFile example tutorial

零下一度
Release: 2017-05-19 14:05:41
Original
2025 people have browsed it

asp fso: Create File CreateTextFile Example Tutorial

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

FileSystemObject.CreateTextFile(filename[,overwrite[,unicode]])FolderObject.CreateTextFile(filename[,overwrite[,unicode]])
Copy after login

Tutorial on operating files.

<%
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
%>
Copy after login

Tutorial on operating folders.

<%
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
%>
Copy after login

The above is the content carefully prepared by the editor for you. There is also related content in the editor's blog, Q&A, public account, people, courses and other columns. You are welcome to continue to use the search button in the upper right corner to search for files.

【Related recommendations】

1. Detailed explanation of CreateTextFile instance in FSO component

2. Share an article about ASP CreateTextFile Definition and usage

The above is the detailed content of asp fso: create file CreateTextFile example tutorial. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template