📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "利用WinRar压缩和解压缩文件"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 1 '所有者中心
Begin VB.TextBox Text1
Height = 345
Left = 645
TabIndex = 3
Text = "Text1"
Top = 1710
Width = 3390
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 405
Left = 300
TabIndex = 2
Top = 2280
Width = 4155
End
Begin VB.CommandButton Command2
Caption = "解压缩本程序目录下文件111.rar到目录new下"
Height = 405
Left = 300
TabIndex = 1
Top = 1200
Width = 4155
End
Begin VB.CommandButton Command1
Caption = "压缩本程序目录下文件111.jpg为本目录111.rar"
Height = 405
Left = 300
TabIndex = 0
Top = 540
Width = 4155
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mystr As String
Dim Source As String ' 源文件
Dim Target As String ' 目标文件
Dim retval
Private Sub Command1_Click()
mystr = "C:\Program Files\WinRAR\winrar.exe" 'winrar.exe文件路径
Source = App.Path & "\111.jpg"
Target = App.Path & "\111.rar" '压缩格式可以是rar,也可以是cab....
mystr = mystr & " a " & Target & " " & Source '命令字符串
retval = Shell(mystr, vbHide)
End Sub
Private Sub Command2_Click()
mystr = "C:\Program Files\WinRAR\winrar.exe"
Source = App.Path & "\111.rar"
Target = App.Path & "\new" '存放压缩文件的位置
mystr = mystr & "X" & Source & " " & Target
Text1.Text = mystr
retval = Shell(mystr, vbHide)
End Sub
Private Sub Command3_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -