|
#cs ----------------------------------------------------------------------------
AutoIt 版本: 3.2.3.12第二版)
脚本作者:
Email:
QQ/TM:
脚本版本:
脚本功能:
#ce ----------------------------------------------------------------------------
; 脚本开始 - 在这后面添加您的代码.
#include <GUIConstantsEx.au3>
#include <File.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $Button_1, $Button_2, $msg, $var1, $var2, $right, $left
GUICreate("Tool",220,40)
Opt("GUICoordMode", 2)
$Button_1 = GUICtrlCreateButton("Moving Right", 10, 10, 100)
$Button_2 = GUICtrlCreateButton("Moving Left", 5, -24, 100)
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
$var1 = FileOpenDialog("Open", @MyDocumentsDir, "1(*.1)" , 1 )
If @error Then
MsgBox(4096,"","File Not Found!")
Else
$right = MsgBox(4+32,"Moving Right","Replace the File?")
If $right=6 Then
_ReplaceStringInFile ( $var1, "18:", "19:", 0 , 1 )
_ReplaceStringInFile ( $var1, "15:", "18:", 0 , 1 )
_ReplaceStringInFile ( $var1, "14:", "15:", 0 , 1 )
MsgBox(0, "Moving Right", "Finished & Saved! ")
EndIf
EndIf
Case $msg = $Button_2
$var2 = FileOpenDialog("Open BMS", @MyDocumentsDir, "1(*.1)" , 1 )
If @error Then
MsgBox(4096,"","File Not Found!")
Else
$left = MsgBox(4+32,"Moving Left","Replace the File?")
If $left=6 Then
_ReplaceStringInFile ( $var2, "11:", "16:", 0 , 1 )
_ReplaceStringInFile ( $var2, "12:", "11:", 0 , 1 )
_ReplaceStringInFile ( $var2, "13:", "12:", 0 , 1 )
MsgBox(0, "Moving Left", "Finished & Saved! ")
EndIf
EndIf
EndSelect
WEnd
EndFunc |
|