views:

44

answers:

1

I have a few .NET apps which use the HttpWebRequest. My gut says i can create a config or manifest file and set the proxy data in there and .NET will automatically load it. But i dont know if that exist and if my gut is wrong.

Is there a way to set the proxy data for my apps? Can i do the same for my one app that uses the ie browser control?

+1  A: 

Do you need to use a different proxy? Or the system's proxy? Note that WebBrowser will probably work differently since this is activex, but IIRC HttpWebRequest will use the winhttp proxy by default. So all you need to do is configure winhttp!

How to do this varies per OS; typically it is easiest to simply import the wininet settings from IE:

Vista/Win7:

netsh winhttp import proxy source=ie

XP (from memory, please double-check):

proxycfg -u

You can also set the proxy per-application (rather than system-wide) via the config file; see MSDN.

Marc Gravell
how do i write a per app proxy when it isnt asp? After googling i can only find web.config
acidzombie24
That would be app.config (which becomes MyApplication.exe.config)
Marc Gravell
Thanks :D (make this 15 letters)
acidzombie24