Chinaunix首页 | 论坛 | 博客
  • 博客访问: 648917
  • 博文数量: 107
  • 博客积分: 4135
  • 博客等级: 上校
  • 技术积分: 1182
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-06 16:01
文章分类

全部博文(107)

文章存档

2020年(2)

2012年(5)

2011年(6)

2010年(23)

2009年(17)

2008年(35)

2007年(19)

我的朋友

分类:

2008-04-08 13:05:28

Private Sub Command1_Click() '确认数据备份
Dim s As String
s = MsgBox("准备好了吗?", vbYesNo + vbQuestion, "提示")
If s = vbNo Then
Exit Sub
End If
On Error GoTo errprompt
Me.MousePointer = 11
If Dir(Text1.Text & ":\数据备份", vbDirectory) = "" Then
MkDir Text1.Text & ":\数据备份"
Set bf = CreateObject("Scripting.FileSystemObject")
bf.CopyFile App.Path & "system.dll", Text1.Text & ":\数据备份\system" & Date & ".dll"
Me.MousePointer = 0
s = MsgBox("数据已备份完毕!", vbInformation, "提示")
errprompt:
Me.MousePointer = 0
Select Case Err.Number
Case 57
s = MsgBox("磁盘已满!", vbCritical, "提示")
Case 70
s = MsgBox("磁盘写保护!请回到原文件进行复制system.dll", vbCritical, "提示")
End Select
Else
On Error GoTo errprompt1
Set bf = CreateObject("Scripting.FileSystemObject")
bf.CopyFile App.Path & "system.dll", Text1.Text & ":\数据备份\system" & Date & ".dll"
Me.MousePointer = 0
s = MsgBox("数据已备份完毕!", vbInformation, "提示")
errprompt1:
Me.MousePointer = 0
Select Case Err.Number
Case 57
s = MsgBox("磁盘已满!", vbCritical, "提示")
Case 70
s = MsgBox("磁盘写保护!请回到原文件进行复制system.dll", vbCritical, "提示")
End Select
End If
End Sub
阅读(1001) | 评论(0) | 转发(0) |
0

上一篇:vbs脚本实例

下一篇:CVS服务器的配置

给主人留下些什么吧!~~