Bonjour,
je souhaiterais à partir d'un script AutoIt récupérer les paramètres IP et port du proxy d'ie (ou du navigateur par défaut)
Ne trouvant rien à lire directement dans la base de registre avec RegRead, j'ai pensé via InetRead lire une page PHP qui détecte les paramètre du proxy (IP et port) pour pouvoir les stocker dans des variables du script.
Le but est au final de passer en paramètre les informations de proxy à un executable vnc serveur ou bien d'exécuter ce serveur vnc avec les information détectées par HttpSetProxy en demandant le login et mot de passe proxy à l'utilisateur si nécessaire.
Je débute dans l'utilisation d'AutoIt mais pas de la programmation.
Je fais appel à vous pour ne pas avoir à réinventer la roue.
Je vous remercie de toute piste qui me permettrait d'avancer sur ce sujet.
[..] Récupération des paramètres proxy d'IE
Règles du forum
- Merci de consulter la section "Règles du forum" et plus particulièrement "Règles et Mentions Légales du site autoitscript.fr" avant d'écrire un message.
- jbnh
- Niveau 11

- Messages : 1932
- Enregistré le : ven. 02 mai 2008 14:54
- Localisation : Bruxelles
- Status : Hors ligne
Re: [..]récupération des paramètres proxy d'IE
Salut,
Dans la base de registre, là : HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\
Tu as deux clés : ProxyEnable et ProxyServer. C'est ce que tu recherches je pense et tu peux les modifier avec autoit.
Dans la base de registre, là : HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\
Tu as deux clés : ProxyEnable et ProxyServer. C'est ce que tu recherches je pense et tu peux les modifier avec autoit.
Balise [..] devant votre requête en cours, [R] quand résolu | Pas de message concernant les bots !
Merci
Merci
Re: [..]récupération des paramètres proxy d'IE
J'ai trouvé des clefs de registre sur le forum anglais:
http://www.autoitscript.com/forum/index ... ntry723701
Voici le lien MSDN pour obtenir la config proxy d'IE :
http://msdn.microsoft.com/en-us/library ... S.85).aspx
Ce qui donne en Autoit:
Sinon je ne sais pas exactement ce que tu veux faire, peut etre ce post peut t'aider :
http://autoitscript.fr/forum/viewtopic. ... ilit=proxy
http://www.autoitscript.com/forum/index ... ntry723701
Voici le lien MSDN pour obtenir la config proxy d'IE :
http://msdn.microsoft.com/en-us/library ... S.85).aspx
Ce qui donne en Autoit:
Code : Tout sélectionner
#include <Array.au3>
Global $aIEproxy = _WinHttpGetIEProxyConfigForCurrentUser()
_ArrayDisplay($aIEproxy, "Internet Explorer proxy configuration")
; #FUNCTION# ;===============================================================================
; Name...........: _WinHttpGetIEProxyConfigForCurrentUser
; Description ...: Retrieves the Internet Explorer proxy configuration for the current user.
; Syntax.........: _WinHttpGetIEProxyConfigForCurrentUser()
; Parameters ....: None.
; Return values .: Success - Returns array with 4 elements:
; |$array[0] - if 1 indicates that the Internet Explorer proxy configuration for the current user specifies "automatically detect settings",
; |$array[1] - auto-configuration URL if the Internet Explorer proxy configuration for the current user specifies "Use automatic proxy configuration",
; |$array[2] - proxy URL if the Internet Explorer proxy configuration for the current user specifies "use a proxy server",
; |$array[3] - optional proxy by-pass server list.
; Failure - Returns 0 and sets @error:
; |1 - DllCall failed
; |2 - Internal failure.
; Author ........: trancexx
; Modified.......:
; Remarks .......:
; Related .......: _WinHttpDetectAutoProxyConfigUrl, _WinHttpGetDefaultProxyConfiguration, _WinHttpSetDefaultProxyConfiguration
; Link ..........: http://msdn.microsoft.com/en-us/library/aa384096(VS.85).aspx
; Example .......:
;============================================================================================
Func _WinHttpGetIEProxyConfigForCurrentUser()
Local Const $hWINHTTPDLL__WINHTTP = DllOpen("winhttp.dll")
Local $tWINHTTP_CURRENT_USER_IE_PROXY_CONFIG = DllStructCreate("int AutoDetect;" & _
"ptr AutoConfigUrl;" & _
"ptr Proxy;" & _
"ptr ProxyBypass;")
Local $aCall = DllCall($hWINHTTPDLL__WINHTTP, "bool", "WinHttpGetIEProxyConfigForCurrentUser", "ptr", DllStructGetPtr($tWINHTTP_CURRENT_USER_IE_PROXY_CONFIG))
If @error Or Not $aCall[0] Then Return SetError(1, 0, 0)
Local $iAutoDetect = DllStructGetData($tWINHTTP_CURRENT_USER_IE_PROXY_CONFIG, "AutoDetect")
Local $pAutoConfigUrl = DllStructGetData($tWINHTTP_CURRENT_USER_IE_PROXY_CONFIG, "AutoConfigUrl")
Local $pProxy = DllStructGetData($tWINHTTP_CURRENT_USER_IE_PROXY_CONFIG, "Proxy")
Local $pProxyBypass = DllStructGetData($tWINHTTP_CURRENT_USER_IE_PROXY_CONFIG, "ProxyBypass")
Local $sAutoConfigUrl
If $pAutoConfigUrl Then
Local $iAutoConfigUrlLen = __WinHttpPtrStringLenW($pAutoConfigUrl)
If Not @error Then
Local $tAutoConfigUrl = DllStructCreate("wchar[" & $iAutoConfigUrlLen + 1 & "]", $pAutoConfigUrl)
$sAutoConfigUrl = DllStructGetData($tAutoConfigUrl, 1)
__WinHttpMemGlobalFree($pProxyBypass)
EndIf
EndIf
Local $sProxy
If $pProxy Then
Local $iProxyLen = __WinHttpPtrStringLenW($pProxy)
If Not @error Then
Local $tProxy = DllStructCreate("wchar[" & $iProxyLen + 1 & "]", $pProxy)
$sProxy = DllStructGetData($tProxy, 1)
__WinHttpMemGlobalFree($pProxy)
EndIf
EndIf
Local $sProxyBypass
If $pProxyBypass Then
Local $iProxyBypassLen = __WinHttpPtrStringLenW($pProxyBypass)
If Not @error Then
Local $tProxyBypass = DllStructCreate("wchar[" & $iProxyBypassLen + 1 & "]", $pProxyBypass)
$sProxyBypass = DllStructGetData($tProxyBypass, 1)
__WinHttpMemGlobalFree($pProxyBypass)
EndIf
EndIf
Local $aOutput[4] = [$iAutoDetect, $sAutoConfigUrl, $sProxy, $sProxyBypass]
Return $aOutput
EndFunc ;==>_WinHttpGetIEProxyConfigForCurrentUser
Func __WinHttpMemGlobalFree($pMem)
Local $aCall = DllCall("kernel32.dll", "ptr", "GlobalFree", "ptr", $pMem)
If @error Or $aCall[0] Then Return SetError(1, 0, 0)
Return 1
EndFunc ;==>__WinHttpMemGlobalFree
Func __WinHttpPtrStringLenW($pString)
Local $aCall = DllCall("kernel32.dll", "dword", "lstrlenW", "ptr", $pString)
If @error Then Return SetError(1, 0, 0)
Return $aCall[0]
EndFunc ;==>__WinHttpPtrStringLenW
Sinon je ne sais pas exactement ce que tu veux faire, peut etre ce post peut t'aider :
http://autoitscript.fr/forum/viewtopic. ... ilit=proxy

