栏目导航
热点推荐
- ASP下批量删除数据的两种方法
- 关于二级域名共享cookies
- ASP错误代码大全
- ASP代码实现show.asp?id=26变成s
- ASP错误信息解决:IIS启用父路径
- 一些常用的正则表达式大全
- ASP超级链接和HTML函数正则表达
- ASP隐藏下载地址及防盗代码
- 最常用的正则表达式示例
- ASP程序数据库被挂马的处理方法
- ASP生成html的新方法
- 精通ASP错误提示大全
阅览排行
asp fso:创建文件 CreateTextFile 实例教程
www.jz123.cn 2008-11-13 来源: 中国建站 编辑整理 我要投递新闻
asp fso:创建文件 CreateTextFile 实例教程
CreateTextFile方法创建一个新的文本文件在当前文件夹中,并传回TextStream物件,可以用来读取或写入档案。
语法
语法
FileSystemObject.CreateTextFile(filename[,overwrite[,unicode]])
FolderObject.CreateTextFile(filename[,overwrite[,unicode]])
Parameter | Description |
---|---|
filename | Required. The name of the file to create |
overwrite | 任择。一个布尔值,表明是否现有的文件可以被覆盖。真正表明该文件可以覆盖和虚假表明该文件不能被覆盖。预设值是true |
unicode | 任择。一个布尔值,表明是否文件被创建为Unicode或ASCII文件。真指出,档案是创建一个Unicode文件,虚假表明该文件是创建一个ASCII文件。默认值为false |
对文件操作教程.
<% 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 %>对文件夹操作教程.<% 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 %>
0
上一篇:优化你的ASP程序 下一篇:asp fso教程:asp move文件移动实例教程