Getting the proxy server settings.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I get the proxy setting for the current machine? I can view them in
IE but I want to be able to display/change them through my own interface.

TIA - Jeff.
 
Jeff,

In order to change the settings, you will have to make calls to the
functions in the WinInet library through the P/Invoke layer. Specifically,
the functions you want to call are InternetSetOption and InternetGetOption.

These options ^might^ be available through WMI (I've never really
looked, but almost everything is there, so it doesn't hurt to check).
 
How can I get the proxy setting for the current machine? I can view them in
IE but I want to be able to display/change them through my own interface.

TIA - Jeff.

You need to connect to the machine registry remotely...

The registry keys that house the proxy data are:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings]
"ProxyServer"="<your proxy IP address>"
"ProxyEnable"=dword:00000001
"ProxyOverride"="<local>"

Just lookup how to access a machines registry remotely via C#...
 
I just realized you said "Current" machine. Just access the registry
on the machine and you can update all the info you need to via the
Keys above.
 
That's actually the wrong way to do it, as the registry is an
implementation detail. The proper way is through the WinInet classes.
 

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

Back
Top