string ls_FileName,lb_FileDatas,lb_FileData
long ll_FileLen,ll_Handle,ll_Loop,ll_Bytes,ll_Loops,ll_NewPos
ls_filename='e:data.txt'
//统计总容量
ll_FileLen = FileLength(ls_FileName)
If ll_FileLen < 0 Then
MessageBox("提示!","文件" + ls_FileName + "不存在或正在使用!")
return
End If
ll_Handle = FileOpen(ls_FileName,StreamMode!,Read!,LockRead!)
If ll_FileLen > 32765 Then ll_Loops = ((ll_FileLen - 1) / 32765) + 1
For ll_Loop = 1 To ll_Loops
ll_Bytes = FileRead(ll_Handle,lb_FileData)
lb_FileDatas = lb_FileDatas + lb_FileData
ll_NewPos = ll_NewPos + ll_Bytes
FileSeek(ll_Handle,ll_NewPos,FromBeginning!)
Next