TestPing, Allenamento

« Older   Newer »
  Share  
Panico0
CAT_IMG Posted on 19/8/2013, 20:26     +1   -1




Dopo molto tempo di assenza da Autoit sono tornato e per esercitarmi ho fatto questa cosetta penso ci sia anche qualche errore , se avete consigli dite pure
#include <buttonconstants.au3>
#include <guiconstantsex.au3>
#include <progressconstants.au3>
#include <staticconstants.au3>
#include <windowsconstants.au3>
$i= 0
$sito = "speedtest.net"
$stato = "Avviare Test"
$ping = ping("speedtest.net",250)
$Form1 = GUICreate("Ping test ", 419, 208, 218, 122)
$Progress1 = GUICtrlCreateProgress(7, 96, 273, 41)
$Label1 = GUICtrlCreateLabel("Ping test", 60, 35, 190, 60)
GUICtrlSetFont(-1, 35, 400, 0, "Mongolian Baiti")
$Versionew = GUICtrlCreateLabel("Versione:"&@OSVersion, 280, 0, 300, 60)
$ServicePack = GUICtrlCreateLabel("ServicePack:"&@OSServicePack, 280, 15, 300, 60)
$pcname = GUICtrlCreateLabel("PcName:"&@ComputerName, 280, 30, 300, 60)
$sping = GUICtrlCreateLabel("Stato Ping:"&$stato, 280, 45, 300, 60)
GUICtrlSetColor(-1, 0x000000)
$Button1 = GUICtrlCreateButton("Esegui Test ping ", 56, 160, 169, 25)
$Label2 = GUICtrlCreateLabel("Stato ping ", 280, 152, 92, 28)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
$menu2 = GUICtrlCreateMenu("File")
$item1 = GUICtrlCreateMenuItem("Guarda cronologia",$menu2)


$menu = GUICtrlCreateMenu("?")
$list = GUICtrlCreateMenuItem("Impostazioni",$menu)
$item2 = GUICtrlCreateMenuItem("Velocitą connessione ",$menu)
$item3= GUICtrlCreateMenuItem("Creatore ",$menu)



GUISetState(@SW_SHOW)





While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

case $Button1

if ping("speedtest.net",250) == 0 Then
$stato= "Errore riprova test !"
EndIf
if ping("speedtest.net",250) < 100 or ping("speedtest.net",250)==100 Then
$stato="Buono !"
else
$stato="Medio !"
EndIf









ProgressOn("Ping...", "Caricamento ..", "0 percentuale")
For $i = 5 To 100 Step 10
Sleep(100)
ProgressSet($i, $i & " %")
Next
ProgressSet(100, "Avanti", "Completato")
Sleep(500)
ProgressOff()
$ris = MsgBox(4,"Salvataggio ","salvarlo nella cronologia ping ? ")
if $ris=6 Then

FileWrite("CronologiaPing.txt",@crlf&"Orario/"&@hour&":"&@min&"|DATA /"&@mday&"/"&@mon&"/"&@year&"PING = " &$ping&@CRLF)
MsgBox(0,"Successo !","File salvato con successo ")
FileOpen(@DesktopDir&"\CronologiaPing.txt",1)
Call("_Update")
Call("_Update1")
EndIf
Call("_Update")





case $item1
ShellExecute("CronologiaPing.txt")
Case $item2
ShellExecute("www.speedtest.net")
case $item3
$Form1 = GUICreate("Creato da ..", 184, 184, 252, 126)
$Group1 = GUICtrlCreateGroup("Creatore ", 0, 0, 201, 193)
$Label1 = GUICtrlCreateLabel("Creato by : RENATO ", 8, 24, 109, 17)
$Label2 = GUICtrlCreateLabel("Email :[email protected]", 8, 56, 153, 17)
$Label3 = GUICtrlCreateLabel("Programma :PingTest 1.0 ", 8, 88, 126, 17)
$Label4 = GUICtrlCreateLabel("Versione : 1.0 ", 8, 120, 72, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd






case $list

$Form2 = GUICreate("Impostazioni", 201, 101, 192, 124)
$Input1 = GUICtrlCreateInput("www.esempio.it", 40, 40, 129, 21)
$Label1 = GUICtrlCreateLabel("Imposta sito ping ", 40, 8, 140, 17)
$Button1 = GUICtrlCreateButton("Applica", 40, 72, 121, 25)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Guidelete($Form2)
ExitLoop

case $button1

$sito = guictrlread($Input1)
$i= +1
Guidelete($Form2)
ExitLoop




EndSwitch
WEnd

EndSwitch
WEnd


Func _Update()
Guictrlsetdata($Label2,ping($sito,250))

Endfunc
Func _Update1()
Guictrlsetdata($sping,"Stato Ping :"&$stato)
Endfunc
 
Top
0 replies since 19/8/2013, 20:26   378 views
  Share