哪位有PB中文件壓縮和解壓縮的例子?陶清網站下載不了,請有收藏的朋友幫忙發給我一個.急用!

xhwly 2005-09-15 11:46:43
哪位有PB中文件壓縮和解壓縮的例子?陶清網站下載不了,請有收藏的朋友幫忙發給我一個.急用!

3536230@163.com


謝謝!
...全文
112 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
j9dai 2005-09-17
  • 打赏
  • 举报
回复
利用Winrar的DLL
saiche05 2005-09-16
  • 打赏
  • 举报
回复
ing
hangzhou6274 2005-09-16
  • 打赏
  • 举报
回复
以前有个MYZIP的DLL可以下载的,这里应该也有例子吧,你搜索一下看看
e_xu 2005-09-16
  • 打赏
  • 举报
回复
boye_xu@sina.com
已发,根据自己需要,修改传递参数。

nv_Compression inv_Comp
bollean ib_flag
inv_Comp = create nv_Compression
li_flag=inv_comp.of_compressfile(gs_pathname)//压缩的文件路径,返回值为1成功
choose case li_flag
case 1
ib_flag=f_ys_input(gs_pathname,0,"",0,"")//返回值为true成功.我的传递参数
....
case else
....
end choose


f_ys_output(ls_path,0,"",0,"")

linv_Comp.of_uncompressfile(ls_path)//解压文件
xhwly 2005-09-16
  • 打赏
  • 举报
回复
以下程序ll_handle 得到的為何總是0 ? 我用的是繁體中文win2000, 執行calc.exe,標題就是"小算盤"呀.FindWindowA中的兩個參數到底該如何用?

//定義全局外部函數
Function long FindWindowA (String lpClassName , String lpWindowName ) Library "user32.dll"
Function boolean IsWindow (Long hwnd ) Library "user32.dll"

string ls_a,ls_b
long ll_handle

run("calc.exe",Maximized!)
ls_a="calc"
ls_b="小算盤"
for li_loop= 1 to 100000
ll_handle = FindWindowA(ls_a,ls_b)
yield()
if ll_handle <> 0 then
exit
end if
next

Do While IsWindow( ll_handle )
Yield()
Loop


另請見新開貼
http://community.csdn.net/Expert/topic/4275/4275218.xml?temp=1.642108E-04

xhwly 2005-09-15
  • 打赏
  • 举报
回复
感謝: yaokeguo(克哥)

不過,我不想用winrar和winzip之類的軟件,我想要一個pb調用動態庫的方式實現的程序.
WorldMobile 2005-09-15
  • 打赏
  • 举报
回复
yaokeguo 2005-09-15
  • 打赏
  • 举报
回复
自动解压语句:run(C:\Program Files\WinRAR\WinRAR.exe x D:\接收邮件附件\*.rar D:\解压附件\)

自动压缩稍为麻烦点:下面给你一个我自己做的压缩过程,仅供参考:

listbox my_listbox
my_listbox = create listbox
parent.OpenUserObject(my_listbox,0,0)
my_listbox.reset( )
my_listbox.dirlist(ls_fkxx,16)
int a,i
a = my_listbox.totalitems( )

string ls_text
//判断文件夹中有无子文件夹
if a = 1 then
messagebox("提示:","你所指定的文件夹:[ "+ls_fkxx+" ]中没有要压缩的子文件夹或文件。")
return
else
for i = 1 to a
ls_text = my_listbox.text( i )
if ls_text <> '[..]' and left(ls_text,1) = '[' then
l_dir = left(right(ls_text,len(ls_text) - 1),len(right(ls_text,len(ls_text) - 1)) - 1)
ysml = ls_rar_path+"\WinRAR.exe a -ep -r0 "+ls_fkys+l_dir+".rar "+ls_fkxx+l_dir+"\*.*"
elseif match(ls_text,'.') = true and left(ls_text,1) <> '[' then
l_dir = ls_text
ysml = ls_rar_path+"\WinRAR.exe a -ep -r0 "+ls_fkys+l_dir+".rar "+ls_fkxx+l_dir+"\*.*"
end if

// 用外部程序来控制RUN的进程
st_3.text = "正在创建压缩文件: "+l_dir+".rar"
ulong ll_handle
int li_loop
SetPointer(HourGlass!)
//最小化执行
run(ysml, Minimized!)
//循环到窗口打开,根据程序执行打开所需的时间设定li_loop的循环次数,可预留长一些。
for li_loop= 1 to 10000
ll_handle = FindWindowA("tty","正在创建压缩文件 "+l_dir+".rar")
st_4.text = string(ll_handle)
yield() //函数作用详见“PB技巧”中《Pb中Yield()函数的使用》
if ll_handle <> 0 then
exit
end if
next
//一直循环到窗口关闭
Do While isWindow(ll_handle)
Yield()
Loop
next
st_3.text = "压缩无毕!"
if messagebox("提示:","已完成压缩,选择“确定”系统将清空存放各部门返馈信息的文件夹以便下月用来存放新的返馈信息,你要清空吗?",Exclamation!, OKCancel!, 2) = 1 then
fu_deletefolder(ls_fkxx,parent,"")
end if
end if

397

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 非技术版
社区管理员
  • 非技术版社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧