bonjour,
J'ai un petit pb pour remplir un array.
je vaux faire une petite interface qui me permette d'activer, désactiver, arrêter ou démarrer le service vnc sur une station.
J'en suis pour l'instant à afficher l'état du service dans ma gui.
et déjà premier pb. Je voulais regrouper les informations nécessaires dans un array, et afficher ça dans ma gui.
seulement mon array $MessageService1 reste vide.
si je sépare chaque ligne de ce tableau par des variables indépendantes ça fonctionne bien.
Je ne vois pas ce que j'ai mal fait....
ci dessous le code.
merci
► Afficher le texte
Code : Tout sélectionner
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.2.10.0
Author: Fred39
Script Function: activation désactivation du service winvnc pour cohabitation avec italc
#ce ----------------------------------------------------------------------------
#include <INet.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <ServiceControl.au3>
;déclaration des variables
;------------------------------------------------------------------------------
$Service1="winvnc"
$CheminRegStartServic1="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\winvnc"
$Service2="rien"
$CheminRegStartServic2="rien"
Dim $EtatService1, $RegStartService1, $TypeDemarService1, $EtatService2, $RegStartService2, $TypeDemarService2
Dim $MessageService1[2]
;fin déclaration des variables
;------------------------------------------------------------------------------
;traitement premier service
;------------------------------------------------------------------------------
If _ServiceExists("", $service1) Then
If _ServiceRunning("", $Service1) Then
$EtatService1="démarré"
else
$EtatService1="arrêté"
EndIf
$RegStartService1 = RegRead($CheminRegStartServic1, "Start")
Select
Case $RegStartService1 = 2
$TypeDemarService1= "automatique"
Case $RegStartService1 = 3
$TypeDemarService1= "manuel"
Case $RegStartService1 = 4
$TypeDemarService1= "désactivé"
Case Else
$TypeDemarService1= "impossible à déterminer"
EndSelect
$MessageService1[0] = "le type de démarrage du service " & $Service1 & " est " & $TypeDemarService1
$MessageService1[1] = "son état est : " & $EtatService1
Else
$MessageService1[0] = "Le service " & $Service1 & "n'est pas installé"
$MessageService1[1] = "pensez à l'installer"
EndIf
MsgBox(4096, "Test", $MessageService1)