当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO CopyTo 方法
The CopyTo method is used to copy a specified number of characters or bytes from an open Stream object into another open Stream object.
CopyTo的作用是:从一个记录流对象中复制制定数目的字符/字节数到另一个已打开的记录流对象中。
The type of the two Stream objects should be the same. However, text Stream objects can be copied into binary Stream objects, but not vice-versa, and the CharSet property of the destination Stream object can be different than the source Stream object.
Destination Stream object[目标记录流对象]和Source Stream object[源记录流对象]这两个记录流对象的类型应该是相同的。然而,文本记录流对象可以被复制进二进制记录流对象中,但是返过来却不行;目标记录流对象中的CharSet属性与源记录流对象是有区别的。
objStream.CopyTo dest,numchars |
Parameter参数 | Description描述 |
---|---|
dest | Required. Where to copy the Stream (contains a reference to an open Stream object) 必要参数。指定需要复制的记录流地址(包含一个用于打开记录流对象的参数) |
numchars | Optional. An integer that specifies the number of characters or bytes to be copied from the current position in the source Stream to the destination Stream. Default is -1 (will copy all data from the current position to EOS) 可选参数。指定一个整数,用于指示从当前源记录流中的指定位置复制到目标记录流中的字符或字节的数量。默认值为-1。(它会复制从当前位置起到末尾的所有数据) Note: If the specified number is greater than the available number of bytes/characters until EOS, then only bytes/characters from the current position to EOS are copied |