Sur mon projet de script, j'ai un problème concernant les boutons "Valider" "Annuler et la croix pour la "fermeture de l'applet :
-Les bouton n'ont aucune action, seul moyen pour clore : le gestionnaire des tâches ...
bref une demi journée de retard, je commence à tourné en rond....
ci joint le script :
► Afficher le texte
Code : Tout sélectionner
#cs ----------------------------------------------------------------------------
AutoIt Version : 3.3.0.0
Auteur: hakim
Fonction du Script : lancement du process de connexion VPN + Mapping des lecteurs reseaux
#ce ----------------------------------------------------------------------------
#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
#include <EditConstants.au3>
#include <Array.au3>
#include <IE.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
Local $Button_1, $Button_2, $Button_3
Dim $username
Dim $VPNSRV
Dim $Program
Dim $params
Dim $Password
;reinitialisation des variables
$username = ""
$Password = ""
$VPNSRV = ""
$Program = ""
$params = ""
;Définition de la boite de dialogue
GUICreate("Connexion VPN - wolrd company",375,500)
GUICtrlCreateLabel ("URL du serveur VPN:",10,15)
$VPNSRV = GUICtrlCreateInput ("adress.serveur.com:Nport",150,10,200 ) ;saisie : serveur vpn
GUICtrlCreateLabel ("Login :",10,45) ;saisie : username, password
$username = GUICtrlCreateInput ("Saisissez ici le nom de l'utilisateur",150,40,200,$username) ;
GUICtrlCreateLabel ("Mot de passe :",10,75) ;
$Password = GUICtrlCreateInput ("",150,70,200,20,$ES_PASSWORD) ;
;fin saisie
;checkbox choix serveur
GuiCtrlCreateGroup("Veuillez cocher votre site de travail: R:\", 5, 240, 366, 90)
$Checkbox1 = GUICtrlCreateCheckbox("Serveur A", 32,140)
$Checkbox2 = GUICtrlCreateCheckbox("Serveur B",250, -1 )
$Checkbox3 = GUICtrlCreateCheckbox("Serveur C", 32, 190)
$Checkbox4 = GUICtrlCreateCheckbox("Serveur D", 250, -1)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group
;fin checkbox
;bouton Choix de connexion : 3G ADSL ....
GuiCtrlCreateGroup("Veuillez cocher le serveur ou se trouve vos données de travail: R:\", 5, 100, 366, 120)
$Button_1 = GUICtrlCreateCheckbox("3G", 32,260,75)
$Button_2 = GUICtrlCreateCheckbox("ADSL",150,260, -1 )
$Button_3 = GUICtrlCreateCheckbox("Bureau ", 260, -1)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group
;fin bouton
;bouton OK / annuler
$Valider = GUICtrlCreateButton("Valider",100,450,75,25,-1)
$Annuler = GUICtrlCreateButton("Annuler",200,450,75,25,-1)
;fin bouton annuler / ok
GUISetState() ; will display an dialog box with 2 button
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg(1)
select
Case $msg = $GUI_EVENT_CLOSE
Exit
ElseIf $Button_2 = true then
RunWait('regedit /s "C:\Program Files\Fortinet\SSLVPNclient\3G\adsl.reg"') ;Lance l'application
MsgBox(64, 'Vérification', 'présrequis ADSL validés', @CRLF , 2) ;valide l'installation du .reg
Elseif $Button_3 = true then
MsgBox(0, 'Vérification', 'Fonction non implémentée',2)
ElseIf
$Checkbox1 = true then
DriveMapAdd ("R:", "\\serveurC,8) ; MAP DFS A
ElseIf $Checkbox2 = true then
DriveMapAdd ("R:", "\\serveurB,8) ;MAP DFS B
ElseIf $Checkbox3 = true then
DriveMapAdd ( "R:", "\\serveurC,8) ;MAP DFS C
ElseIf $Checkbox4 = true then
DriveMapAdd ("R:", \\serveurD,8) ;MAP DFS D
$Program = 'C:\Program Files\Fortinet\SSLVPNclient\FortiSSLVPNclient.exe'
$params = "connect -h " & GUICtrlRead($VPNSRV) & " -u """ & GUICtrlRead($username,0) & """:""" & GUICtrlRead($Password) & """"
ShellExecute ($Program, $params)
EndIf
Endselect
wend
EndFunc
adresseIPcheck()
func adresseIPcheck()
Local $ip1=@IPAddress1
If StringInStr($ip1,"x.X.Y.") Then
;MsgBox(64, "","connexion vpn établie, connexion de votre M: : "&@CRLF & $ip1, 0,5)
DriveMapAdd ( "M:", @homeshare , 8 ) ;Map répertoire privé de l'utilisateur
else
MsgBox(48, "","connexion vpn non établie : "&@CRLF & $ip1, 0,5 )
EndIf
EndFuncps: je fais un max d'effort pour comprendre, mais là y a un truc qui m'échappe :/
hakim !



