本帖最后由 sh1536 于 2020-4-3 22:49 编辑
#RequireAdmin#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <FileConstants.au3>
#include <Date.au3>
#include <GuiMenu.au3>
Global $a = "c:\数据上传\data\backup"
Global $c = "c:\数据上传\DBDATA\backup"
Global $b = "d:\数据上传\data\backup"
Global $d = "d:\数据上传\DBDATA\backup"
Global $qTime = 2000 ;备份时间间隔
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("历史数据保存", 230, 180, -1, -1)
$Menu = GUICtrlCreateMenu("菜单")
$hMenu = GUICtrlGetHandle($Menu)
$MenuItem1 = GUICtrlCreateMenuItem("暂停", $Menu)
$MenuItem2 = GUICtrlCreateMenuItem("退出", $Menu)
$Label1 = GUICtrlCreateLabel("进程", 10, 16, 230, 17)
$Edit1 = GUICtrlCreateEdit("", 32, 64, 185, 89)
GUISetState(@SW_SHOW)
AdlibRegister("_beifen", $qTime)
#EndRegion ### END Koda GUI section ###
_beifen() ;打开软件先备份一次
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
GUISetState(@SW_SHOWMINIMIZED)
Case $MenuItem1
If _GUICtrlMenu_GetItemText($hMenu, $MenuItem1, False) = "暂停" Then
AdlibUnRegister("_beifen")
GUICtrlSetData($Edit1, "备份暂停")
_GUICtrlMenu_SetItemText($hMenu, $MenuItem1, "继续", False)
Else
_beifen()
AdlibRegister("_beifen", $qTime)
_GUICtrlMenu_SetItemText($hMenu, $MenuItem1, "暂停", False)
EndIf
Case $MenuItem2
Exit
EndSwitch
WEnd
Func _beifen()
GUICtrlSetData($Edit1, "备份中...")
DirMove($a, $b, 1)
DirMove($c, $d, 1)
GUICtrlSetData($Label1,"数据正常备份"&" "&_NowCalc())
EndFunc
|