📄 frmback.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form FrmDataRestore
Caption = "数据还原"
ClientHeight = 4785
ClientLeft = 60
ClientTop = 450
ClientWidth = 7335
LinkTopic = "Form1"
ScaleHeight = 4785
ScaleWidth = 7335
StartUpPosition = 2 '屏幕中心
Begin VB.DriveListBox Drive1
Height = 300
Left = 2640
TabIndex = 6
Top = 4320
Width = 2895
End
Begin VB.DirListBox Dir1
Height = 2610
Left = 2640
TabIndex = 5
Top = 1680
Width = 2895
End
Begin MSComCtl2.DTPicker DTP1
Height = 375
Left = 4200
TabIndex = 4
Top = 1080
Width = 1335
_ExtentX = 2355
_ExtentY = 661
_Version = 393216
Format = 48889857
CurrentDate = 38845
End
Begin VB.FileListBox File1
Height = 2970
Left = 120
TabIndex = 2
Top = 1680
Width = 2415
End
Begin VB.TextBox txtfileName
Height = 375
Left = 120
TabIndex = 1
Top = 1080
Width = 2415
End
Begin MSComctlLib.ImageList ImageList1
Left = 2280
Top = 240
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frmback.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frmback.frx":0452
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 855
Left = 0
TabIndex = 0
Top = 0
Width = 7335
_ExtentX = 12938
_ExtentY = 1508
ButtonWidth = 1455
ButtonHeight = 1349
Appearance = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 2
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "数据还原"
ImageIndex = 2
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出"
ImageIndex = 1
EndProperty
EndProperty
Begin VB.Timer Timer1
Interval = 1000
Left = 3240
Top = 1080
End
End
Begin VB.Label lblfreesize
BackStyle = 0 'Transparent
ForeColor = &H00000000&
Height = 375
Left = 5760
TabIndex = 15
Top = 4200
Width = 1335
End
Begin VB.Label lblusesize
BackStyle = 0 'Transparent
ForeColor = &H00000000&
Height = 375
Left = 5760
TabIndex = 14
Top = 3480
Width = 1335
End
Begin VB.Label lbltotalsize
BackStyle = 0 'Transparent
ForeColor = &H00000000&
Height = 375
Left = 5760
TabIndex = 13
Top = 2760
Width = 1335
End
Begin VB.Label lblDrive
BackStyle = 0 'Transparent
ForeColor = &H00000000&
Height = 375
Left = 5760
TabIndex = 12
Top = 1920
Width = 1335
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "剩余空间:"
Height = 255
Left = 5760
TabIndex = 11
Top = 3960
Width = 1335
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "使用空间"
Height = 255
Left = 5760
TabIndex = 10
Top = 3240
Width = 1335
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "总计空间:"
Height = 255
Left = 5760
TabIndex = 9
Top = 2400
Width = 1335
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "当前驱动器:"
Height = 255
Left = 5760
TabIndex = 8
Top = 1680
Width = 1335
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "驱动器信息"
BeginProperty Font
Name = "隶书"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5640
TabIndex = 7
Top = 1080
Width = 1575
End
Begin VB.Shape Shape1
Height = 3135
Left = 5640
Top = 1560
Width = 1575
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "备份日期"
BeginProperty Font
Name = "隶书"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
TabIndex = 3
Top = 1080
Width = 1095
End
Begin VB.Image Image1
Height = 480
Left = 2640
Picture = "Frmback.frx":08A4
Top = 1080
Width = 480
End
End
Attribute VB_Name = "FrmDataRestore"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim fso As FileSystemObject
Dim fil As File
Dim TimeDelay As Integer
Dim Basename As String
Dim start As Boolean
Private Sub Dir1_Change()
File1.Path = Dir1.Path
File1.Pattern = "*.*"
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
lblDrive.Caption = UCase(Drive1.Drive)
End Sub
Private Sub File1_Click()
txtfilename.Text = File1.filename
End Sub
Private Sub Form_Load()
FrmDataRestore.BackColor = RGB(77, 116, 244)
Drive1.Drive = "d:"
Dir1.Path = "d:\system\database"
lblDrive.Caption = UCase(Drive1.Drive)
'Set drv = fso.GetDrive(fso.GetDriveName(Drive1.Drive))
'lbltotalsize.Caption = FormatNumber(drv.TotalSize / 1024, 0)
'lblfreesize.Caption = FormatNumber(drv.FreeSpace / 1024, 0)
' lblusesize.Caption = FormatNumber(drv.TotalSize / 1024 - drv.FreeSpace / 1024, 0)
TimeDelay = 0
start = False
End Sub
Private Sub Image1_Click()
Dim FileExist As Boolean
If txtfilename.Text = "" Then
MsgBox "请选择要恢复的数据库"
Exit Sub
End If
If Right(Dir1.Path, 1) = "\" Then
Basename = Dir1.Path + File1.filename
Else
Basename = Dir1.Path + "\" + File1.filename
End If
FileExist = fso.FileExists(Basename)
If FileExist = fase Then
MsgBox "指定的文件不存在,请重新选择数据库文件"
Exit Sub
Else
start = True
TimeDelay = 0
frmWait.Show 1
End If
End Sub
Private Sub Timer1_Timer()
TimeDelay = TimeDelay + 1
If TimeDelay >= 3 And start = True Then
Set fil = fso.GetFile(Basename)
fil.Copy "d:\system\database\system.mdb", True
Unload Me
start = False
Exit Sub
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
Image1_Click
Case 2
Unload Me
frmmain.Show
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -