上传者: jianjunzhao
|
上传时间: 2022-06-09 10:38:42
|
文件大小: 2KB
|
文件类型: SRU
PB12.5,PB12.6下调试通过
把SRU导入即可。
integer li_FileNum, loops, i
long flen, bytes_read, new_pos
blob b, tot_b
flen = FileLength(filename)
if flen = 0 then
messagebox('提示','文件长度为0!',StopSign!)
return ""
end if
li_FileNum = FileOpen(filename, StreamMode!, Read!, LockRead!)
if li_fileNum = -1 then
messagebox('提示','打开文件失败!',StopSign!)
return ""
end if
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
new_pos = 1
FOR i = 1 to loops
bytes_read = FileRead(li_FileNum, b)
tot_b = tot_b + b
NEXT
FileClose(li_FileNum)
string ls_return
//nvo_base64 luo_base64
//ls_return =base64head+ luo_base64.base64encode(tot_b)
//
n_base64 luo_base64
ls_return = luo_base64.encode(tot_b)
return ls_return