e.Button.Enabled = False
StatusBar.Message2 = "正在备份...请稍候..."
StatusBar.Refresh
Dim dt As String
Dim nm As String
For i As Integer = 1 To 3
Dim ifo As New FileInfo(ProjectPath & "备份\bak" & i)
If i = 1 Then
dt = ifo.CreationTime
nm = ifo.Name
Else
If ifo.CreationTime < dt Then
dt = ifo.CreationTime
nm = ifo.Name
End If
End If
Next
FileSys.DeleteDirectory(ProjectPath & "备份\" & nm,2,2)
FileSys.CreateDirectory(ProjectPath & "备份\" & nm)
Syscmd.Project.Backup(ProjectPath & "备份\" & nm, True)
StatusBar.Message2 = ""
StatusBar.Refresh
MessageBox.Show("完毕")
e.Button.Enabled = True
[此贴子已经被作者于2014-9-29 15:24:32编辑过]