Getting user's proxy settings

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
 
S

Sean Hederman

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.
 
S

Sunny

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
 
P

Phil Wilson

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

Sunny

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top