Page 1 sur 1
Afficher SSID connecté
Posté : jeu. 15 juin 2017 10:26
par JujuBois91
Bonjour
Je cherche à faire un script qui permet de retourner le nom du ssid auquel nous sommes connectés, j ai fait plusieurs essaie sans succès
Merci de votre aide
Re: Afficher SSID connecté
Posté : jeu. 15 juin 2017 17:36
par mikell
C'est parce que tu lis le PID du process, pas le retour console ^^
Re: Afficher SSID connecté
Posté : jeu. 15 juin 2017 21:44
par JujuBois91
Salut
Merci de ta réponse, j vais refaire des tests de suite et essayé de me battre avec StringRegExp juste pour récupérer le nom de l SSID
@+
Re: Afficher SSID connecté
Posté : jeu. 15 juin 2017 22:36
par JujuBois91
Re
Une idée de pourquoi ça me retourne "1" et pas le nom du SSID
Re: Afficher SSID connecté
Posté : jeu. 15 juin 2017 22:46
par jchd
1/ Il est où le StdOutRead en boucle ?
2/ $asResult est un tableau
3/ (?s)(?i) devient (?si), plus joli
Re: Afficher SSID connecté
Posté : jeu. 15 juin 2017 22:52
par JujuBois91
Oups

mais toujours un retour à "1"
Re: Afficher SSID connecté
Posté : jeu. 15 juin 2017 23:04
par orax
Comme l'a dit jchd, StringRegExp retourne un tableau. msgbox(0,"SSID", $sSSID[0])
Re: Afficher SSID connecté
Posté : jeu. 15 juin 2017 23:08
par JujuBois91
Ah pardon je n avais pas compris cela, un grand merci
Voici le code qui fonctionne
Re: Afficher SSID connecté
Posté : jeu. 15 juin 2017 23:12
par mikell
Hamdoulilah

Re: Afficher SSID connecté
Posté : ven. 16 juin 2017 09:01
par jchd
C'est sûr ça ?
Parce qu'avec le ÿ dans le pattern je vois mal comment ça fonctionne cette histoire, en tout cas pas chez moi (W7).
Code : Tout sélectionner
#cs
RFC :
The length of the SSID field is between 0 and 32 octets. A SSID field of length 0 is used within Probe
Request frames to indicate the wildcard SSID. The wildcard SSID is also used in Beacon and Probe
Response frames transmitted by mesh STAs.
When the UTF-8 SSID subfield of the Extended Capabilities element is equal to 1 in the frame that includes
the SSID element, or the Extended Capabilities of the source of the SSID information is known to include
the UTF-8 SSID capability based on a previously received Extended Capabilities element, the SSID is
interpreted using UTF-8 encoding. Otherwise, the character encoding of the octets in this SSID element is
unspecified.
#ce
Local $sOutput = Run("netsh wlan show int", "", @SW_HIDE, $STDOUT_CHILD)
Local $sReturn
Do
$sReturn &= StdoutRead($sOutput)
Until @error
Local $sSSID = StringRegExp($sReturn, '(?i)\sSSID\s*:\s(\N*)', 1)[0]
MsgBox(0, "SSID", $sSSID)
Re: Afficher SSID connecté
Posté : ven. 16 juin 2017 22:42
par JujuBois91
Salut
Pour le moment testé sur 2 PC et ok ! Windows 10
Re: Afficher SSID connecté
Posté : dim. 18 juin 2017 20:11
par JujuBois91
Bonjour à tous
Petite question, je souhaiterais afficher mon résultat dans un label cependant je n y arrive pas
Pouvez-vous m'aider ?
merci
Re: Afficher SSID connecté
Posté : lun. 19 juin 2017 17:36
par JujuBois91
C'est Good j ai trouvé merci
