📄 frm_huifu.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frm_huifu
Caption = "恢复数据"
ClientHeight = 4755
ClientLeft = 2580
ClientTop = 2100
ClientWidth = 7005
Icon = "frm_huifu.frx":0000
LinkTopic = "Form2"
ScaleHeight = 4755
ScaleWidth = 7005
Begin MSComDlg.CommonDialog CommonDialog1
Left = 1200
Top = 2880
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame1
Caption = "恢复模式"
Height = 2055
Left = 120
TabIndex = 3
Top = 600
Width = 6735
Begin VB.ListBox List1
Height = 1680
Left = 3360
TabIndex = 9
Top = 240
Width = 3135
End
Begin VB.OptionButton Option1
Caption = "按系统默认目录恢复"
Height = 375
Left = 240
TabIndex = 5
Top = 360
Value = -1 'True
Width = 1935
End
Begin VB.OptionButton Option2
Caption = "按其他目录恢复"
Height = 375
Left = 240
TabIndex = 4
Top = 1320
Width = 1575
End
End
Begin VB.CommandButton Command1
Caption = "开始恢复"
Height = 375
Left = 4080
TabIndex = 2
Top = 4200
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "返回"
Height = 375
Left = 5640
TabIndex = 1
Top = 4200
Width = 1215
End
Begin VB.Frame Frame2
Height = 15
Left = 120
TabIndex = 0
Top = 3960
Width = 6855
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "恢复数据"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 1920
TabIndex = 8
Top = 120
Width = 3015
End
Begin VB.Label Label2
Height = 735
Left = 120
TabIndex = 7
Top = 2640
Width = 6615
End
Begin VB.Label Label3
Caption = "数据时间:"
Height = 375
Left = 240
TabIndex = 6
Top = 3480
Width = 2535
End
End
Attribute VB_Name = "frm_huifu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim fso_bak As New FileSystemObject
Dim foud_bak As Folder
Dim fil_bak As File
Private Sub Command1_Click()
If Option1.Value = True Then
If List1.ListCount > 0 And List1.Text <> "" Then
fso_bak.CopyFile curpath + "backup\" + List1.Text, curpath + "wupin.mdb", True
MsgBox "恢复成功"
Else
MsgBox "请选择恢复的数据!"
End If
Else
If CommonDialog1.FileName = "" Then
MsgBox "请选择恢复的数据!"
Else
fso_bak.CopyFile CommonDialog1.FileName, curpath + "wupin.mdb", True
MsgBox "恢复成功"
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
If Right(App.path, 1) = "\" Then ' 若 App.Path 为根目录
curpath = App.path
Else
curpath = App.path + "\"
End If
Label3.Caption = "数据时间:" + CStr(Date)
Dim fsoa As New FileSystemObject
Dim foud As Folder
Dim fil As File
If fsoa.FolderExists(curpath + "backup") = False Then
fsoa.CreateFolder curpath + "backup"
End If
Set foud = fsoa.GetFolder(curpath + "backup")
For Each fil In foud.Files
If Right(fil, 4) = ".sld" Then
List1.AddItem fil.Name
End If
Next
End Sub
Private Sub Option2_Click()
CommonDialog1.FileName = ""
CommonDialog1.Filter = "*.sld(备份文件)|*.sld"
CommonDialog1.ShowOpen
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -