CreateTextFile 方法
来源:互联网 发布:荧光手写软件下载 编辑:程序博客网 时间:2024/04/29 23:03
创建指定的文件名并返回一个 TextStream 对象,可以使用这个对象对文件进行读写。
object.CreateTextFile(filename[, overwrite[, unicode]])
参数
object
必选项。 应为 FileSystemObject 或 Folder 对象的名称。
filename
必选项。 指明所要创建文件的字符串表达式。
overwrite
可选项。 Boolean 值,指明能否覆盖已有文件。 如果文件可以覆盖,则值为 true ,否则为 false 。 如果忽略,则已有文件不能被覆盖。
unicode
可选项。 Boolean 值,指明文件是否以 Unicode 或 ASCII 文件方式创建。 如果文件作为 Unicode 文件创建,则值为 true ,如果作为 ASCII 文件创建,则为 false。 如果忽略,则假定为 ASCII 文件。
说明
下面的代码说明了如何使用 CreateTextFile 方法来创建和打开一个文本文件。
var fso = new ActiveXObject("Scripting.FileSystemObject");var a = fso.CreateTextFile("c://testfile.txt", true);a.WriteLine("This is a test.");a.Close();
如果 overwrite 参数是 false ,或者没有提供这个参数,那么对于已有的 filename 将产生一个错误。
- CreateTextFile 方法
- CreateTextFile 方法资料(VBA)
- CreateTextFile&OpenTextFile
- vbs脚本:CreateTextFile
- CreateTextFile 文件的使用
- createtextfile遇到http 500错误
- 关于js的CreateTextFile和OpenTextFile
- 方法
- 方法
- 方法
- 方法
- 方法
- 方法
- 方法
- 方法
- 方法
- 方法
- 方法
- 视频采集编程
- ORACLE表分区
- 主流GPS方案供应商大盘点
- Oracle表分区
- error C2660: 'Open' : function does not take 12 parameters
- CreateTextFile 方法
- error C2660: 'SaveAs' : function does not take 11 parameters
- Directshow中的视频捕捉
- 数据库的DML和DDL简述
- 视频网站牵手音乐公司欲以内容谋利
- 改进托管代码的性能
- error C2501: '_Application' : missing storage-class or type specifiers
- 应用程序之间互相通讯的几种方法
- js模糊查询 定位select 下拉框