当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO WriteText 方法

ADO
ADO DataTypes
ADO 摘要
ADO 实例

ADO WriteText 方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 383 ::
收藏到网摘: n/a

The Write method is used to write a text to a text Stream object.
WriteText方法的作用是:将字符数据写到文本记录流对象中。

If there is data in the Stream object and the current position is EOS, the new data will be appended beyond the existing data. If the current position is not EOS, the existing data will be overwritten.
如果该数据是记录流对象中的数据,并且当前位置已处于末尾[EOS],那么新数据将被追加到现有数据的后面。如果当前位置未处于文件末尾[EOS],那么现有数据将被覆盖。

If you write past EOS, the size of the Stream will increase. EOS will be set to the last character in the Stream. If you don't write past EOS, the current position will be set to the next character after the newly added data. Previously existing data will not be truncated. Call the SetEOS method to truncate. 
如果你写入的内容超过了文件的末尾[EOS],那么记录流对象的尺寸将增加,EOS将被设置到记录流对象的最末字节处;如果你写入的内容未超过文件的末尾[EOS],那么当前位置将设置在新添加数据之后的在下一个字节处。先前现存的数据将被截去。可通过请求SetEOS方法截取。

Note: This method is used only with text Stream objects, for binary Stream objects, use the Write method.
注意:这个方法仅用在文本记录流对象中[text Stream objects];如果需要对二进制记录流对象进行操作[binary Stream objects],那么需要使用Write方法。

Syntax
语法

objStream.WriteText data,opt

Parameter参数 Description描述
data Required. The text to be written to a text Stream object
必要参数。指定需要写入一个文本记录流对象中的文本
opt Optional. A StreamWriteEnum value that specifies whether a line separator must be added to the text
可选参数。指定一个StreamWriteEnum值。该值是用来指明是否需要将一个行分隔符添加到文本中


StreamWriteEnum Value

Constant
常量
Value
Description
描述
adWriteChar 0 Default. Writes the specified text to a Stream object
默认值。将指定的文本写入一个记录流对象中
adWriteLine 1 Writes the specified text and a line separator to a Stream object. If the LineSeparator property is not defined, a run-time error will occur
将指定的文本和一个行分隔符写入一个记录流对象中。如果LineSeparator[行分隔符]属性未定义,那么将产生一个运行时间上的错误。

评论 (0) All

登陆 | 还没注册?