1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 155, 83, 351, 180)
$Button1 = GUICtrlCreateButton("Ping", 8, 40, 65, 33)
$Button2 = GUICtrlCreateButton("Copie", 80, 40, 65, 33)
$Label1 = GUICtrlCreateLabel("Ping pour verifier", 16, 8, 124, 17, -1, $WS_EX_CLIENTEDGE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
; tout ce qui est au dessus à été généré par mon drag and drop en koda. 1 minute max
; tes variables
$filedir = "c:\test\*.hex"
$filedest = "\\192.168.0.5\dossier\"
$ip = "127.0.0.1"
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Local $iPing = ping ($ip, 250)
If $iPing Then ; If a value greater than 0 was returned then display the following message.
ControlSetText("Form1", "", $Label1, "périphérique ok")
Else
ControlSetText("Form1", "", $Label1, "périphérique non connecté")
EndIf
Case $Button2
; reste à sécuriser la copie avec un if ;) bon courage :)
FileCopy( $filedir, $filedest ,0 )
EndSwitch
WEnd |
Partager