谁有好用的压缩控件也行!!!
谢谢!
谢谢!
解决方案 »
- 如何判断一个生成的类的实例还存在不存在,存在就释放它,而后再生成这个类的新的实例
- 一个readme.doc文件我添加进了VB资源文件acp.RES中,那么文件的大小、创建日期、名称等属于能通过资源文件访问到吗?
- 请给一段简单的VB代码, 程序使用 AdoDC控件
- 求VB 做的简单的排版系统源码!谢谢!
- 椭圆函数如何使用?!?!1
- 在VB如何編程實現數據庫的備份
- 关于vb得dsn联接问题
- 大家好,请问如何得知一个SQLServer数据库中某个字段是否不许为空?是否为自动编号类型?谢谢!
- 为什么有的api在api浏览器中找不到,比如SHBrowseForFolder?如果以后需要类似的api,应该到哪儿去找??谢谢
- 自制控件,怎样象Timer控件那样,设计时可见,运行时不可见
- 怎么判断操作系统是中文或英文.....
- 求助ActiveReport!
去网上查找……
shell函数是vb中的内部函数,它负责执行一个可执行文件,返回一个variant(double),如果成功的话,代表这个程序的进程id,若不成功,则会返回0。 shell的语法:shell(pathname[,windowstyle])。 pathname 为必需参数。类型为string,它指出了要执行的程序名,以及任何需要的参数或命令行变量,也可以包括路径名。 windowstyle为可选参数。integer类型,指定在程序运行时窗口的样式。windowstyle有以下这些值。 常量 值 描述
vbhide 0 窗口被隐藏,且焦点会移到隐式窗口。
vbnormalfocus 1 窗口具有焦点,且会还原到它原来的大小和位置。
vbminimizedfocus 2 窗口会以一个具有焦点的图标来显示(缺省值)。
vbmaximizedfocus 3 窗口是一个具有焦点的最大化窗口。
vbnormalnofocus 4 窗口会被还原到最近使用的大小和位置,而当前活动的窗口仍然保持活动。
vbminimizednofocus 6 窗口会以一个图标来显示,而当前活动的窗口仍然保持活动。 二、关于winrar的用法
主要介绍以下如何在winrar中用命令行来压缩和解压缩文件。 压缩:winrar a [-switches] [files] [@file lists] 例如你想把try.mdb压缩到c盘下,可以winrar a c:try.rar c:try.mdb 解压缩:如果带目录解压缩 winrar x [-switches] [files] [@file lists] [destionation folder] 如果在当前目录解压缩,即解压缩时不写目录名 winrar e [-switches] [files] [@file lists] [destionation folder] 例如你想把try.rar解压缩到c盘下,可以winrar x c:try.rar c:try.mdb 三、一个例子
在vb中新建一个工程,在form1中添加两个按钮command1、command2和command3,把他们的caption属性分别设为"压缩文件"、"解压缩文件"和"传递文件"。按command1时把文件try.mdb压缩成try.rar。
private sub command1_click() dim rarexe as string ‘winrar执行文件的位置 dim source as string ‘ 压缩前的原始文件 dim target as string ‘ 压缩后的目标文件 dim filestring as string ‘shell指令中的字符串 dim result as long rarexe="c:program fileswinrarwinrar" source="c:try.mdb" target="c:try.rar" filestring = rarexe & " a " & target & " " & source result = shell(filestring, vbhide) end sub 解压的过程类似,按command2可以把try.rar解压生成 try.mdb。在执行了上面的压缩过程后,可以删除文件try.mdb,来解压缩重新生成try.mdb。 private sub command2_click() dim rarexe as string ‘winrar执行文件的位置 dim source as string ‘ 解压缩前的原始文件 dim target as string ‘ 解压缩后的目标文件 dim filestring as string ‘shell指令中的字符串 dim result as long rarexe="c:program fileswinrarwinrar" source="c:try.rar" target="c:try.mdb" filestring = rarexe & " x " & source & " " & target result = shell(filestring, vbhide) end sub 文件从一台计算机传输到另一台计算机前,应知道另一台计算机的名字,然后用filecopy语句就可以了。假设要把压缩后try.rar传递到计算机名为"other"的共享目录"want"下。 private sub command3_click() dim sourcefile, destinationfile sourcefile ="c:try.rar " ‘ 指定源文件名。 destinationfile = "otherwanttry.rar" ‘ 指定目的文件名。 filecopy sourcefile, destinationfile ‘ 将源文件的内容复制到目的文件中。 end sub 怎么样,十分简单吧?
我的需求是把一个文件夹下面的文件压缩成ZIP格式的文件,当然也可以通过压缩控件实现,但找不到好的压缩控件,那位朋友有的话请指点,付费也行。