.xlsx 实际上是ZIP格式文件,完全可以当作 ZIP 文件来处理。
然后直接用 uo_zip 解压它为指定文件,或者直接当作 blob 读出来,都可以。
在各PB群里,找到我的 PB_Json_httpclient_crypto_ftp_xxxxxx.rar 包,里面有个 uo_zip 对象。
1. 打开它:zip.open("c:\temp\Book1.xlsx",false,"")
2.zip 事件 ue_open 里读列表
//取出ZIP文件里的列表
long index[]
string strName[]
long fileSize[]
long fileSizeComp[]
string crc[]
string strDateTime[]
boolean encrypted[]
long ll_count,i
long ll_filecount,ll_dircount
string ls_text
ll_count = zip.GetEntryList(ref index[],ref strName[],ref fileSize[],ref fileSizeComp[],ref crc[],ref strDateTime[],ref encrypted[])
if ll_count = 0 then
blob data
data = blob("欢迎使用uo_zip对象.大自在2020/5/1")
zip.add("hello",data)
end if
ls_text = "序号 大小 压缩大小 CRC码 修改时间 加密~t文件名~r~n"
for i = 1 to ll_count

本文介绍如何将.xlsx文件视为ZIP格式进行处理,利用uo_zip对象读取.xlsx内部结构,包括文件列表、大小、压缩信息等,并演示了如何以blob形式读取文件或解压指定内容。
最低0.47元/天 解锁文章
2077





