请问有没有WINZIP的控件呀。

koolgi 2003-08-29 10:31:01
本人以前在VFP中调用arj压缩程序,在98下没有问题。现在换成了2000系统,发现有的2000系统中发现arj程序不能用,就是用arj压缩的文件生成不了。现在我想用WINZIP,请问可以吗?如果可以的话哪里可以找到WINZIP控件。如何用呀?谢谢大家!
...全文
85 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
k3641ss 2003-12-23
  • 打赏
  • 举报
回复
先搜搜看,说不定会有结果的:)

http://www.sijiqing.com/vbgood/widget/index.asp?action=read&id=163
magnetmoon 2003-08-29
  • 打赏
  • 举报
回复
* DelZip wrapper class.
* Written by Andrus Moor, Eetasoft
* Please send any improvements and suggestions to eetasoft@online.ee

* Required improvements:

* 1. OnProgess() event should allow to interrupt if Esc key or cancel button is
* pressed. .Cancel property does not work.
* 2. OCX file German resource strings should be changed to english using resource hacker:
* http://rpi.net.au/~ajohnson/resourcehacker
* a. You open the zipmaster .ocx file
* b. then choose Action | Replace other resource from the menu
* c. open the desired language resource file (ZipMsgUS.res) from
* http://www.geocities.com/SiliconValley/Network/2114/index.html
* d. Replace the complete string table available (16 times)
* 3. or even better, run time translation should be added.
* 4. I need the option to exlude some files during unzipping.
* 5. If I use options
* .AddDirNames = .t. and
* .AddRecurseDirs = .t.
* and create a zip file in C: disk, it adds a 001 suffix to file name.
* Is it possible to eliminate this: delzip must recognize a hard drive
* and will not apped this suffix ?

* 6. .ocx must be created from the latest delzip release. Problably this
* resolves problems 1-4
* 7. WAIT WINDOW NOWAIT in OnProgress() event flashes strangely. Why ?
* It should be replaced by progress bar.

* 8. Creating zip file to cdrom (mounted using hp easy cd creator) gives error
* this disk could not be formatted but creates zip file ok.

* Sample usage backup whole windows directory:
* x=NEWOBJECT("zip")
* nRes = x.zip( 'result.zip', 'c:\windows\*.*', .f. )
* IF nRes#0
* ... operation fails
* ENDIF
* RETURN

DEFINE CLASS ZIP AS CUSTOM

oZip = .NULL.
cOldFolder = ''

PROCEDURE INIT
#IF VERSION()<'Visual FoxPro 07'
SYS(2333,0)
#ENDIF

THIS.cOldFolder=SYS(5)+SYS(2003)

LOCAL cOnError
cOnError = ON('error')
ON ERROR NOTE
THIS.oZip = CREATEOBJECT( "ZipMastr2XControl1.ZipMastr2X" )
ON ERROR &cOnError

IF VARTYPE( THIS.oZip ) #'O' && For vfp 5-6, use VARTYPE.PRG emulator
* This searces the .exe file starting directory also:
DECLARE INTEGER DllRegisterServer ;
IN ZipM2X.OCX ;
AS __DllRegisterServer__
IF __DllRegisterServer__()#0
MESSAGEBOX( 'ZipMaster registration fails')
SET DEFAULT TO (THIS.cOldFolder)
RETURN .F.
ENDIF
ENDIF

THIS.oZip = CREATEOBJECT( "ZipMastr2XControl1.ZipMastr2X" )
SET DEFAULT TO (THIS.cOldFolder)

#IF VERSION()>='Visual FoxPro 07'
EVENTHANDLER( THIS.oZip, NEWOBJECT("ZipMasterEvents") )
#ENDIF

WITH THIS.ozip
.Verbose = .F.
.Unattended = .F.
.Tempdir = SYS(2023)
ENDWITH

ENDPROC

***********************************
* ZIP and UZIP methods are for simple operations only.
* For more sophisticated control, use oZip property directly.
* lAddMove - .t. if files are moved to file

PROCEDURE ZIP
LPARAMETERS cDestFile, cSourceFiles, lAddMove

WITH THIS.oZip
.ZipFilename = m.cDestFile
* this will not work: .ZipComment = 'Created by Eeva ' + dtoc(date())
.AddMove = m.lAddMove

* This shows password dialog:
* .AddEncrypt = .t.

.AddDirNames = .F.
.AddRecurseDirs = .F.
.AddDiskSpan = .F.
.AddDiskSpanErase = .F.

* bug: this causes 001 appended to enf of file name, even for C: disk.
* .AddDirNames = .t.
*.AddRecurseDirs = .t.
*.addseparatedirs = .t.

.FSpecArgs.ADD(m.cSourceFiles)
.ADD
ENDWITH
SET DEFAULT TO (THIS.cOldFolder)
RETURN THIS.oZip.ErrCode

PROCEDURE UnZip
LPARAMETERS cSrcFile, cDestDir

WITH THIS.oZip
.ZipFilename = m.cSrcFile
.ExtrDirNames = .F.
.extroverwrite = .T.
.ExtrBaseDir= m.cDestDir
.Extract
ENDWITH
SET DEFAULT TO (THIS.cOldFolder)
RETURN THIS.oZip.ErrCode
ENDPROC
ENDDEFINE

#IF VERSION()>='Visual FoxPro 07'

DEFINE CLASS ZipMasterEvents AS CUSTOM
cursize = 0
totalsize= 0
curfile = ''
ncurfile = 0
nfileCnt = 0

IMPLEMENTS IZipMastr2XEvents IN zipm2x.ocx

PROCEDURE IZipMastr2XEvents_OnDirUpdate() AS VOID
ENDPROC

* ProgrType values:
#DEFINE d_NewFile 0 && NewFile
#DEFINE d_ProgressUpdate 1 && ProgressUpdate
#DEFINE d_EndOfBatch 2 && EndOfBatch
#DEFINE d_TotalFiles2Process 3 && TotalFiles2Process
#DEFINE d_TotalSize2Process 4 && TotalSize2Process

PROCEDURE IZipMastr2XEvents_OnProgress(ProgrType AS VARIANT, ;
Filename AS STRING, FileSize AS NUMBER) AS VOID

DO CASE
CASE ProgrType=d_TotalSize2Process
THIS.cursize = 0
THIS.totalsize = FileSize

CASE ProgrType=d_Totalfiles2Process
THIS.nCurFile = 0
THIS.nfileCnt = FileSize

CASE ProgrType=d_NewFile
THIS.nCurFile = THIS.nCurfile +1
THIS.curfile = Filename

CASE ProgrType = d_EndOfBatch
WAIT CLEAR

OTHERWISE
THIS.cursize = THIS.cursize + filesize
* bug: constand width wait window flashes. Why ?
WAIT WINDOW NOCLEAR AT SROWS()/2, SCOLS()/5 NOWAIT ;
'Total ' + TRANSFORM(THIS.cursize/THIS.TotalSize*100,'999')+'%'+CHR(13) + ;
'File ' + THIS.curfile + CHR(13) + ;
SPACE(120)+ CHR(13) + ;
'Files ' +TRANSFORM(THIS.nCurFile)+ '/'+TRANSFORM(THIS.nfileCnt)+ CHR(13)+ ;
'KBytes ' +LTRIM(TRANSFORM(THIS.cursize/1024,'999 999 999 999'))+ '/'+LTRIM(TRANSFORM(THIS.totalsize/1024,'999 999 999 999'))
ENDCASE
* Bug: it is not possible to interrupt: this did not work:
*IF INKEY()=27
* .cancel = .t.
* ENDIF

ENDPROC

PROCEDURE IZipMastr2XEvents_OnMessage(ErrCode AS NUMBER, MESSAGE AS STRING) AS VOID
* critical errors are writen out even if this procedure does not run
IF ErrCode#0
MESSAGEBOX( 'Error '+TRANSFORM(Errcode, '@0') + CHR(13) + ;
TRANSFORM(MESSAGE), 'Zip', 16 )
ENDIF
ENDPROC
ENDDEFINE

#ENDIF
foreverlove6 2003-08-29
  • 打赏
  • 举报
回复
是ActviX的吗?
去VB乐园下载
koolgi 2003-08-29
  • 打赏
  • 举报
回复
好的,谢谢,我用一用
newfang 2003-08-29
  • 打赏
  • 举报
回复
我有一个dll函数库及其说明,要不??
经过测试的!!

2,749

社区成员

发帖
与我相关
我的任务
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
  • VFP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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