Ok i am able use a proxy with basic auth but after i navigate to the page i want to click a link but when i do i get the login information. the page behind does change but but i get the auth window. what i want to happen is not to have the auth window. I can hit cancel or ok it reall does not matter the page loaded just fine behind the login window. Is there a way to catch that window and tell it go go away. Here is the code for setting up the proxy.
<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
' Filling in structure
struct_IPI.dwAccessType = INTERNET_OPEN_TYPE_PROXY
struct_IPI.proxy = System.Runtime.InteropServices.Marshal.StringToHGl obalAnsi(strProxy)
struct_IPI.proxyBypass = System.Runtime.InteropServices.Marshal.StringToHGl obalAnsi("local")
' Allocating memory
Dim intptrStruct As IntPtr = System.Runtime.InteropServices.Marshal.AllocCoTask Mem(System.Runtime.InteropServices.Marshal.SizeOf( struct_IPI))
' Converting structure to IntPtr
System.Runtime.InteropServices.Marshal.StructureTo Ptr(struct_IPI, intptrStruct, True)
Dim iReturn As Boolean = iReturn = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY, intptrStruct, System.Runtime.InteropServices.Marshal.SizeOf(stru ct_IPI))
End Sub
Ok its not loading the page behind the login. is there a way to add the basic auth header to the webbrowser or what has to be done here can i use a system.net.webproxy to accomplish this but from how do you set it to the webbrowser request.