📄 copyfile.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form copyfiles
Caption = "备份数据"
ClientHeight = 2880
ClientLeft = 5040
ClientTop = 4530
ClientWidth = 5415
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2880
ScaleWidth = 5415
StartUpPosition = 1 '所有者中心
Begin MSComDlg.CommonDialog CommonDialog1
Left = 4560
Top = 2280
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton Command4
Caption = "取消"
Height = 375
Left = 1920
TabIndex = 7
Top = 2400
Width = 975
End
Begin VB.CommandButton Command3
Caption = "确定"
Height = 375
Left = 3120
TabIndex = 6
Top = 2400
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "浏览"
Height = 975
Left = 4920
TabIndex = 3
Top = 1200
Width = 375
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 960
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Top = 1200
Width = 3855
End
Begin VB.CommandButton Command1
Caption = "浏览"
Height = 975
Left = 4920
TabIndex = 1
Top = 120
Width = 375
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 = 975
Left = 960
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
Top = 120
Width = 3855
End
Begin VB.Label Label2
Caption = "备份到:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 5
Top = 1440
Width = 1095
End
Begin VB.Label Label1
Caption = "从:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 600
TabIndex = 4
Top = 480
Width = 615
End
End
Attribute VB_Name = "copyfiles"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
CommonDialog1.filter = "*.mdb"
CommonDialog1.ShowOpen
If CommonDialog1.filename <> "" Then
If Right(CommonDialog1.filename, 4) <> ".mdb" Then
Text1.Text = CommonDialog1.filename + ".mdb"
Else
Text1.Text = CommonDialog1.filename
End If
End If
End Sub
Private Sub Command2_Click()
CommonDialog1.filter = "*.mdb"
CommonDialog1.ShowSave
If CommonDialog1.filename <> "" Then
If Right(CommonDialog1.filename, 4) <> ".mdb" Then
Text2.Text = CommonDialog1.filename + ".mdb~bak"
Else
Text2.Text = CommonDialog1.filename + "~bak"
End If
End If
End Sub
Private Sub Command3_Click()
If (frmMain.Surrpath = Text1.Text And Text1.Text <> "" And Text2.Text <> "") Then
MsgBox "当前文件被打开,无权限! " & " **请备份其他文件**", vbOKOnly, "警告"
ElseIf (Text1.Text <> "" Or Text2.Text <> "") Then
FileCopy Text1.Text, Text2.Text
MsgBox "完成备份!", vbOKOnly, "提示"
Else
MsgBox "文件路径为空!", vbOKOnly, "警告"
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
If frmMain.Surrpath <> "" Then
copyfiles.Text1.Text = frmMain.Surrpath
copyfiles.Text2.Text = frmMain.Surrpath + "~bak"
Else
copyfiles.Text1.Text = ""
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -