asp fso:创建文件 CreateTextFile 实例教程

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

asp fso:创建文件 CreateTextFile 实例教程

CreateTextFile方法创建一个新的文本文件在当前文件夹中,并传回TextStream物件,可以用来读取或写入档案。 
语法

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

对文件操作教程.

<%
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

对文件夹操作教程.

<%
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

以上是小编为您精心准备的的内容,在小编的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索文件 。

【相关推荐】

1. FSO组件中CreateTextFile实例详解

2. 分享一篇ASP CreateTextFile 的定义和用法

The above is the detailed content of asp fso:创建文件 CreateTextFile 实例教程. 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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!