📄 bck.frm
字号:
VERSION 5.00
Begin VB.Form bck
Caption = "备份/恢复"
ClientHeight = 5355
ClientLeft = 60
ClientTop = 345
ClientWidth = 6210
LinkTopic = "Form1"
ScaleHeight = 5355
ScaleWidth = 6210
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "返回"
Height = 495
Left = 2040
TabIndex = 9
Top = 4440
Width = 1695
End
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
TabIndex = 7
Top = 3360
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "确认"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 6
Top = 3360
Width = 1815
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 5
Top = 2280
Width = 4095
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 255
Left = 2520
TabIndex = 1
Top = 960
Width = 255
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 255
Left = 480
TabIndex = 0
Top = 960
Value = -1 'True
Width = 255
End
Begin VB.Label Label4
Caption = "请选择操作:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 8
Top = 480
Width = 1455
End
Begin VB.Label Label3
Caption = "请输入存储路径:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 4
Top = 1680
Width = 1695
End
Begin VB.Label Label2
Caption = "恢复"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2880
TabIndex = 3
Top = 960
Width = 1455
End
Begin VB.Label Label1
Caption = "备份"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 840
TabIndex = 2
Top = 960
Width = 1335
End
End
Attribute VB_Name = "bck"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim fso As New FileSystemObject
Dim mulu As Folder
Dim fil As File
Private Sub Command1_Click()
If Option1.Value Then
s = Text1.Text
i = 1
l = Len(Text1.Text)
mu1 = ""
Do While i < l
mu2 = ""
ch = Mid(s, i, 1)
Do While ch <> "\"
mu2 = mu2 + ch
i = i + 1
If i > l Then
Exit Do
End If
ch = Mid(s, i, 1)
Loop
i = i + 1
If mu1 = "" Then
mu1 = mu1 & mu2
Else
mu1 = mu1 & "\" & mu2
End If
If Dir(mu1) = "" Then '不可以备份到根目录下?
If Not fso.FolderExists(mu1) Then
Set mulu = fso.CreateFolder(mu1) 'Microsoft Scriping Runtime
End If
Set fil = fso.GetFile(App.Path & "\sourse.mdb")
fil.Copy (mu1 & "\sourse.mdb")
MsgBox ("备份完成")
End If
Loop
Else
If fso.FileExists(Text1.Text & "\sourse.mdb") Then
Set fil = fso.GetFile(Text1.Text & "\english.mdb")
fil.Copy (App.Path & "\sourse.mdb")
MsgBox ("数据已经恢复")
Else
MsgBox ("原始文件未找到")
End If
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -