0

hi i have a problem during navigate in webbrowser using private proxy i can navigate with a public proxy with this script but i can't do this with proxy authentification (ip:port:user:pass)

''''''''''''''''''''''proxy'''''''''''''''''''''''

Friend Structure Struct_INTERNET_PROXY_INFO
    Public dwAccessType As Integer
    Public proxy As IntPtr
    Public proxyBypass As IntPtr
End Structure

<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 = 38
    Const INTERNET_OPEN_TYPE_PROXY = 3
    Dim struct_IPI As Struct_INTERNET_PROXY_INFO
    struct_IPI.dwAccessType = INTERNET_OPEN_TYPE_PROXY
    struct_IPI.proxy = Marshal.StringToHGlobalAnsi(strProxy)
    struct_IPI.proxyBypass = Marshal.StringToHGlobalAnsi("local")

    Dim intptrStruct = Marshal.AllocCoTaskMem(Marshal.SizeOf(struct_IPI))
    Marshal.StructureToPtr(struct_IPI, intptrStruct, True)
    Dim iReturn = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY, intptrStruct, Marshal.SizeOf(struct_IPI))
End Sub



''''''''''''''''''''''End proxy'''''''''''''''''''''''*

any help please

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
  • Set also `INTERNET_OPTION_PROXY_PASSWORD` and `INTERNET_OPTION_PROXY_USERNAME` (as `TCHAR`: `WCHAR` if CharSet is Unicode, otherwise `CHAR`). See the notes [here](https://stackoverflow.com/a/51471736/7444103), to refresh/propagate the new settings. – Jimi Feb 11 '20 at 03:13
  • It's going to be saved in the Registry, might be easier to change it there than use Win32 API calls, google areound using this RegKey: **HKCU:/Software/Microsoft/Windows/CurrentVersion/Internet Settings/Connections** – Jeremy Thompson Feb 11 '20 at 03:17
  • thanks jimi , im beginer can you please edited my code with a good to connect using user and pass – Boubekri Abderrahmane Feb 11 '20 at 03:25

0 Answers0