Getting user's proxy settings

  • Thread starter Thread starter Sunny
  • Start date Start date
S

Sunny

This is repost, as I had some problems with my antispam alias.

Hi,

I need my application (C#, .Net framework 1.1 SP1) to be able to detect
the automatic proxy configuration for the user. I can get the settings
if they are entered. (with GlobalProxySelection.Select)

I just don't know how to obtain the settings IE receives, when
"Automatically detect settings" is enabled in LAN Settings. Or if using
automatic configuration script.

Any help will be highly appreciated.

Sunny
 
Sunny said:
This is repost, as I had some problems with my antispam alias.

Hi,

I need my application (C#, .Net framework 1.1 SP1) to be able to detect
the automatic proxy configuration for the user. I can get the settings
if they are entered. (with GlobalProxySelection.Select)

I just don't know how to obtain the settings IE receives, when
"Automatically detect settings" is enabled in LAN Settings. Or if using
automatic configuration script.

I haven't used it, but check out the InternetQueryOption WinINet API in
MSDN.
 
I haven't used it, but check out the InternetQueryOption WinINet API in
MSDN.

Thanks,

but it seems that this is not exactly what I'm after. I haven't check it
deeply, but I guess that way I can get if the user is using a proxy
script or automatic settings. But after that as far as I read, the
browser somehow interprets this data to get the actual server. That is
the part which I miss. Otherwise, I guess these settings are in the
registry somewhere, so I can get them.

Sunny
 
Look at WinHttpGetProxyForUrl - there is example code in MSDN using it to
get proxy servers.
 
Look at WinHttpGetProxyForUrl - there is example code in MSDN using it to
get proxy servers.

Sweet, exactly what I needed.

Now, go deep for how to implement P/Invoke call :)

Thanks Phil

Sunny
 
Back
Top