循环读写啊,给你一个例子:
long flen, bytes_read, new_pos
integer fh, ret,loops,i
blob b, tot_b
string txtname, named
string defext = "BMP"
string Filter = "bitmap Files (*.bmp), *.bmp"
ret = GetFileOpenName("Open Bitmap", txtname, &
named, defext, filter)
// Set a wait cursor
SetPointer(HourGlass!)
// Get the file length, and open the file
flen = FileLength(txtname)
// Determine how many times to call FileRead
IF flen > 32765 THEN
IF Mod(flen, 32765) = 0 THEN
loops = flen/32765
ELSE
loops = (flen/32765) + 1
END IF
ELSE
loops = 1
END IF
IF ret = 1 THEN
fh = FileOpen(txtname, StreamMode!, Read!, LockRead!)
IF fh <> -1 THEN
new_pos = 1
FOR i = 1 to loops
bytes_read = FileRead(fh, b)
tot_b = tot_b + b
NEXT
FileClose(fh)
p_1.SetPicture(tot_b)
p_1.setredraw(true)
cb_1.visible=true
pic=tot_b
END IF
END IF