📄 main_sjhf.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form main_sjhf
BorderStyle = 1 'Fixed Single
Caption = "数据恢复"
ClientHeight = 1725
ClientLeft = 45
ClientTop = 330
ClientWidth = 5730
Icon = "main_sjhf.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 1725
ScaleWidth = 5730
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 4530
TabIndex = 3
Top = 1290
Width = 1120
End
Begin VB.CommandButton Command1
Caption = "开始"
Height = 375
Left = 3330
TabIndex = 2
Top = 1290
Width = 1120
End
Begin VB.Frame Frame1
Caption = "进度显示"
Height = 1050
Left = 120
TabIndex = 0
Top = 120
Width = 5535
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 420
Left = 240
TabIndex = 1
Top = 360
Width = 5055
_ExtentX = 8916
_ExtentY = 741
_Version = 393216
Appearance = 1
End
End
End
Attribute VB_Name = "main_sjhf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim workarea(6) As String '定义字符串变量
Dim str1 As String
Dim str2 As String
Dim char As Byte
Private Sub Command1_Click()
A = MsgBox("确认恢复数据库?", 4, "系统提示")
If A = vbYes Then
Command1.Enabled = False
ProgressBar1.Visible = True
'ProgressBar 控件通过从左到右用一些方块填充矩形来表示一个较长操作的进度。
ProgressBar1.Max = UBound(workarea)
ProgressBar1.Value = ProgressBar1.Min
For Counter = LBound(workarea) To UBound(workarea)
'LBound 函数返回一个 Long 型数据,其值为指定数组维可用的最小下标。
'UBound 函数返回一个 Long 型数据,其值为指定的数组维可用的最大下标。
workarea(Counter) = "initial value " & Counter
ProgressBar1.Value = Counter
Open str1 For Binary As #1
Open str2 For Binary As #2
Do While Not EOF(1)
Get #1, , char
Put #2, , char
Loop
Close
Next Counter
ProgressBar1.Value = ProgressBar1.Min
MsgBox "数据库恢复成功!", , "系统提示"
Command1.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Main.Enabled = True
Unload Me
End Sub
Private Sub Form_Load()
str1 = App.Path & "\数据库备份\db_kfgl.mdb"
str2 = App.Path & "\db_kfgl.mdb"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -