473,320 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Proxy With Webbrowser control

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.
Jul 22 '08 #1
0 1029

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Soul | last post by:
Hi, I am learning to code a WinForm application which will need to access a Web Service outside the University network. Our University require us to go through a proxy in order to access the...
0
by: ddd | last post by:
Hi, I am trying to figure out how to set the http proxy server for a webbrowser control. I basically want to have a webbrowser control on a form and let the user specify the URL they want to...
0
by: Jim Hubbard | last post by:
How would I implement the IDispatch interface to handle the following in VB.Net <BEGIN> Controlling Download and Execution The WebBrowser Control gives you control over what it downloads,...
12
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but...
1
by: Hasan O. | last post by:
Hi, I am trying to write a program that includes a webbrowser ( System.Windows.Forms.WebBrowser ) , it works good. I have two question about that 1 - how can i make this webbrowser to use...
8
by: Prosperz | last post by:
Hi, I would like to make thumbnails of web page by capture content of a WebBrowser. By example, capture http://www.google.com. I used WebBrowser control with Framework 2.0. I try this : ...
11
by: Anil Gupte | last post by:
....and how do I insert one into my form? I used in VB 6.0 last, but cannot figure out where it is in .Net Thanx, -- Anil Gupte www.keeninc.net www.icinema.com
9
by: AGP | last post by:
My project uses a Webbroswer control to navigate to certain websites and do some processing on the info found there. However, my company has a proxy server which I must authenticate through to get...
4
by: Jon | last post by:
I wrote a VS 2005 C# express programme that accesses a web service. It works fine when there's a direct connection to the internet, but on two different PCs with internet access via a proxy, I get...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.