วิธี การ ADO CopyTo
❮ การอ้างอิงออบเจกต์สตรีมที่สมบูรณ์
เมธอด CopyTo ใช้เพื่อคัดลอกจำนวนอักขระหรือไบต์ที่ระบุจากออบเจกต์ Stream ที่เปิดอยู่ไปยังออบเจ็กต์ Stream อื่นที่เปิดอยู่
ประเภทของอ็อบเจ็กต์ Stream ทั้งสองควรเหมือนกัน อย่างไรก็ตาม สามารถคัดลอกออบเจ็กต์สตรีมข้อความไปยังออบเจ็กต์สตรีมแบบไบนารีได้ แต่ไม่ใช่ในทางกลับกัน และคุณสมบัติ 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)
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 |
❮ การอ้างอิงออบเจกต์สตรีมที่สมบูรณ์