|
本帖最后由 ddx13 于 2010-11-21 21:58 编辑
Opt("GUICloseOnESC", 0)
#include <DateTimeConstants.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <GuiStatusBar.au3>
#include <TabConstants.au3>
#include <GuiListView.au3>
#include <GuiTab.au3>
#include <Date.au3>
#include <File.au3>
$GLHF = GUICreate("数据库恢复", 332, 235, -1, -1, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_BORDER))
$GLHFList = GUICtrlCreateListView("", 8, 8, 314, 190, $LVS_SORTASCENDING, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
_GUICtrlListView_AddColumn($GLHFList, "文件名", 85)
_GUICtrlListView_AddColumn($GLHFList, "备份时间", 150)
_GUICtrlListView_AddColumn($GLHFList, "文件大小", 75)
_GUICtrlListView_JustifyColumn($GLHFList, 0, 2)
_GUICtrlListView_JustifyColumn($GLHFList, 1, 2)
_GUICtrlListView_JustifyColumn($GLHFList, 2, 2)
$GLHFB1 = GUICtrlCreateButton("确 定", 48, 208, 70, 20)
$GLHFB2 = GUICtrlCreateButton("退 出", 208, 208, 70, 20)
$MDBBAK = _FileListToArray(@ScriptDir & "\MDBBAK", "*.bak", 1)
If Not @error Then
For $i = 1 To $MDBBAK[0]
$BAKFILEtime = FileGetTime(@ScriptDir & "\MDBBAK\" & $MDBBAK[$i], 1)
$BAKDX = Round(FileGetSize(@ScriptDir & "\MDBBAK\" & $MDBBAK[$i]) / 1024 / 1024, 2) & "MB"
GUICtrlCreateListViewItem($MDBBAK[$i] & "|" & $BAKFILEtime[0] & "年" & $BAKFILEtime[1] & "月" & $BAKFILEtime[2] & "日 " & $BAKFILEtime[3] & ":" & $BAKFILEtime[4] & ":" & $BAKFILEtime[5] & "|" & $BAKDX, $GLHFList)
Next
EndIf
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $GLHFB2
Exit
Case $GLHFB1
$GLHFBAK = GUICtrlRead(GUICtrlRead($GLHFList))
If $GLHFBAK = 0 Then
MsgBox(0, "", $GLHFBAK)
MsgBox(262144, "错误", "请选中你要恢复的数据备份文件!!!")
ContinueLoop
EndIf
$GLHFBAKCF = StringSplit($GLHFBAK, "|", 1)
;IF FileCopy ( @ScriptDir & "\MDBBAK\"&$GLHFBAKCF[1] , $FileMDB , 1)=0 then
; msgbox(262144,"错误","数据备份恢复失败,请重试!!!" , "", $GLF )
; ContinueLoop
;EndIf
AutoItWinSetTitle("注销")
ShellExecute(@AutoItExe, "", @ScriptDir)
Exit
EndSwitch
WEnd |
|