Dim obj_File As FileSystemObject
Dim Cur_Folder As Folder
Dim Cur_Files As Files
Dim Cur_File As File
Dim cur_DBListItem As ListItem
Me.Icon = HelpWindowIcon.Picture
Call ModReSizeForm.ResizeInit(Me)
ImageList1.ListImages.Add , , Image1.Picture
With List_DB_Bak
.ColumnHeaders.Add , , "备份文件名", 3000
.ColumnHeaders.Add , , "文件建立时间", 3000
.SmallIcons = Me.ImageList1
.View = lvwReport
.GridLines = True
.FullRowSelect = True
.LabelEdit = lvwManual
.HideSelection = False
.SortKey = Me.List_DB_Bak.ColumnHeaders(1).Index
.SortOrder = lvwAscending
.Sorted = True
.ListItems.Clear
End With
Set obj_File = CreateObject("Scripting.FileSystemObject")
If obj_File.FolderExists(App.Path & "\DB_Bak") = True Then
Set Cur_Folder = obj_File.GetFolder(App.Path & "\DB_Bak")
Set Cur_Files = Cur_Folder.Files
If Cur_Files.Count <> 0 Then
For Each Cur_File In Cur_Files
If Right$(Cur_File.Name, 3) = "ZIP" Or Right$(Cur_File.Name, 3) = "zip" Or Right$(Cur_File.Name, 3) = "Zip" Then
Set cur_DBListItem = List_DB_Bak.ListItems.Add(, Cur_File.Name, Left$(Cur_File.Name, Len(Cur_File.Name) - 4), , 1)
With cur_DBListItem
.SubItems(1) = Format$(Cur_File.DateCreated, "yyyy-mm-dd hh:mm:ss")
End With
Set cur_DBListItem = Nothing
End If
Next Cur_File
Me.List_DB_Bak.Refresh
Me.cmd_DelAll_Bak_DB.Enabled = True
Else
Me.List_DB_Bak.Enabled = False
End If
End If
Set Cur_File = Nothing
Set Cur_Files = Nothing
Set Cur_Folder = Nothing
Set obj_File = Nothing
err1:
If Err.Number <> 0 Then
Error_Send Err
End If