?? frmbackup.frm
字號:
VERSION 5.00
Begin VB.Form frmBackUp
BorderStyle = 1 'Fixed Single
Caption = "數(shù)據(jù)備份"
ClientHeight = 7680
ClientLeft = 45
ClientTop = 330
ClientWidth = 7890
ForeColor = &H00800000&
Icon = "frmBackUp.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7680
ScaleWidth = 7890
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame frameCurrBackUp
BackColor = &H00C0C0C0&
Caption = "選擇備份路徑"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 4455
Left = 120
TabIndex = 9
Top = 2880
Width = 7455
Begin VB.FileListBox File1
Height = 2430
Left = 3960
TabIndex = 12
Top = 480
Width = 2775
End
Begin VB.CommandButton cmdCancel
BackColor = &H00FFFFFF&
Caption = "取消(&C)"
Height = 735
Left = 4800
Picture = "frmBackUp.frx":0442
Style = 1 'Graphical
TabIndex = 3
Top = 3360
Width = 1095
End
Begin VB.CommandButton cmdSave
BackColor = &H00FFFFFF&
Caption = "備份(&B)"
Height = 735
Left = 1560
Picture = "frmBackUp.frx":07C3
Style = 1 'Graphical
TabIndex = 2
Top = 3360
Width = 1215
End
Begin VB.DirListBox Dir1
Height = 1980
Left = 480
TabIndex = 1
Top = 960
Width = 3015
End
Begin VB.DriveListBox Drive1
Height = 315
Left = 480
TabIndex = 0
Top = 480
Width = 3015
End
End
Begin VB.Frame frameBackup
Caption = "最后備份的情況"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 2535
Left = 120
TabIndex = 4
Top = 120
Width = 7455
Begin VB.Label lblLastTime
Caption = "最后備份的時間"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF8080&
Height = 255
Left = 1200
TabIndex = 11
Top = 1920
Width = 3855
End
Begin VB.Label lblLastDate
Caption = "最后備份的日期"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF8080&
Height = 255
Left = 1200
TabIndex = 10
Top = 1200
Width = 3375
End
Begin VB.Label Time
Caption = " 時 間"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 120
TabIndex = 8
Top = 1800
Width = 975
End
Begin VB.Label lblDate
Caption = " 日 期"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 120
TabIndex = 7
Top = 1200
Width = 975
End
Begin VB.Label lblPath
Caption = " 路 徑"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 120
TabIndex = 6
Top = 480
Width = 975
End
Begin VB.Label lblLastPath
Caption = "最后備份的路徑"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF8080&
Height = 615
Left = 1200
TabIndex = 5
Top = 480
Width = 4935
End
End
End
Attribute VB_Name = "frmBackUp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Dim Fsys As New FileSystemObject
'Dim bckupFile As File
Private Sub Form_Load()
Dim lastPath As String
Dim lastDate As String
Dim lastTime As String
lastPath = GetSetting(App.Title, "Settings", "BackupPath")
lastDate = GetSetting(App.Title, "Settings", "BackupDate")
lastTime = GetSetting(App.Title, "Settings", "BackupTime")
If lastPath = "" Then
lblLastPath.Caption = "沒有備份記錄!"
lblLastDate.Caption = " "
lblLastTime.Caption = " "
Else
lblLastPath.Caption = lastPath
lblLastDate.Caption = lastDate & " (mm-dd-yy)"
lblLastTime.Caption = lastTime
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdsave_click()
On Error Resume Next
cmdSave.Enabled = False
Label1.Caption = "請稍候,正在備份......"
Label1.BackColor = vbGreen
Label1.ForeColor = vbYellow
Dim destination As String
Dim Source As String
Dim currDate, currTime As String
currDate = Format$(Now, "mm - dd - yy")
currTime = Format$(Now, "hh:mm:ss AM/PM")
destination = File1.Path & "\" & "Library.mdb"
Source = App.Path & "\Library.mdb"
Set bckupFile = Fsys.GetFile(finalpath)
bckupFile.Attributes = Compressed
Fsys.CopyFile Source, destination, True
'Saving Current Backup Details
SaveSetting App.Title, "Settings", "BackupPath", destination
SaveSetting App.Title, "Settings", "BackupDate", currDate
SaveSetting App.Title, "Settings", "BackupTime", currTime
Label1.Caption = "已備份.."
Label1.BackColor = vbYellow
Label1.ForeColor = vbBlue
cmdSave.Enabled = True
MsgBox "備份完成!", vbInformation, "備份"
Unload Me
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -