Utiliser proxy

dognico Messages postés 21 Date d'inscription samedi 8 novembre 2008 Statut Membre Dernière intervention 21 juin 2011 - 2 oct. 2010 à 21:29
dognico Messages postés 21 Date d'inscription samedi 8 novembre 2008 Statut Membre Dernière intervention 21 juin 2011 - 3 oct. 2010 à 14:10
Boujour a tt le monde.

Je voudrai avoir un code pour utiliser un proxy (ip + port) pour pouvoir acceder au site web sans passer avec mon adresse ip comme Firefox avec un fichier apare avec la configuration dans le fichier.

merci de vaut reponce

4 réponses

cs_aus3004 Messages postés 319 Date d'inscription jeudi 1 avril 2010 Statut Membre Dernière intervention 16 mars 2011 1
2 oct. 2010 à 21:46
Ca devrait t'aider :

Public Structure Struct_INTERNET_PROXY_INFO
        Public dwAccessType As Integer
        Public proxy As IntPtr
        Public proxyBypass As IntPtr
    End Structure
    <Runtime.InteropServices.DllImport("wininet.dll", SetLastError:=True)> _
        Private Shared Function InternetSetOption(ByVal hInternet As IntPtr, ByVal dwOption As Integer, ByVal lpBuffer As IntPtr, ByVal lpdwBufferLength As Integer) As Boolean
    End Function

    Private Sub RefreshIESettings(ByVal strProxy As String)
        Const INTERNET_OPTION_PROXY As Integer = 38
        Const INTERNET_OPEN_TYPE_PROXY As Integer = 3
        Dim struct_IPI As Struct_INTERNET_PROXY_INFO
        struct_IPI.dwAccessType = INTERNET_OPEN_TYPE_PROXY
        struct_IPI.proxy = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(strProxy)
        struct_IPI.proxyBypass = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi("local")
        Dim intptrStruct As IntPtr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(System.Runtime.InteropServices.Marshal.SizeOf(struct_IPI))
        System.Runtime.InteropServices.Marshal.StructureToPtr(struct_IPI, intptrStruct, True)
        Dim iReturn As Boolean = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY, intptrStruct, System.Runtime.InteropServices.Marshal.SizeOf(struct_IPI))
    End Sub



Ma LV2 c'est le Visual Basic, et toi ?
0
dognico Messages postés 21 Date d'inscription samedi 8 novembre 2008 Statut Membre Dernière intervention 21 juin 2011
3 oct. 2010 à 13:45
ca fonctionne mais a chaque fois que je clique sur un élèment d'une page j'ai une erreur d'internet explorer de java; pi ca peut etre possible je voudrai passer par un fichier appar & pas par internet explorer.
0
cs_aus3004 Messages postés 319 Date d'inscription jeudi 1 avril 2010 Statut Membre Dernière intervention 16 mars 2011 1
3 oct. 2010 à 14:00
Pour virer les erreurs java script tu pourrais utiliser :
webbrowser1.ScriptErrorsSuppressed = True

Sinon j'ai pas trop d'idée

bon dev


Ma LV2 c'est le Visual Basic, et toi ?
0
dognico Messages postés 21 Date d'inscription samedi 8 novembre 2008 Statut Membre Dernière intervention 21 juin 2011
3 oct. 2010 à 14:10
ca fonctionne bien meme ci c'est pas trop ca je fait faire avec t'en que je pa trouver le code pour faire comme je veux merci
0
Rejoignez-nous