I would like my webBrowser to run off proxys from a listbox. Everytime it were to start over I would like it to go down the list of proxys and choose the next one. My program is a webBrowser bot.

Dani AI

Generated

— rotating proxies every run is doable, but the implementation depends on whether you actually need a rendered IE/DOM session or only HTTP fetches. 's pointer toward .NET proxy support is a good start; below are practical options, tradeoffs and quick tips.

If you do not need full browser rendering or JavaScript, do the network work yourself (HttpClient/HttpWebRequest) and assign a proxy per request. That gives clean per-request proxy control and simple rotation; persist the last-used index to a small settings file and increment it on startup. See the HttpClient and WebProxy docs for per-request proxy handling: HttpClient and WebProxy.

If you must use the WinForms WebBrowser (IE engine), its networking is driven by the WinINet/IE settings. You can update WinINet proxy settings programmatically (InternetSetOption) before creating the control and refresh the settings, but that changes the user session proxy and can affect other IE/WebBrowser instances. To limit side effects, set the proxy and host the WebBrowser in a fresh process; coordinate updates and be aware of race conditions. See the API docs: and the WebBrowser overview: WebBrowser control overview.

For per-instance proxies without touching system settings, use an embeddable Chromium (CefSharp) or drive real browsers via Selenium/Chromedriver — both let you give each instance its own proxy (command-line or driver options). See CefSharp and Selenium for examples: CefSharp General Usage and Selenium Proxy API.

Quick troubleshooting tips: pre-validate proxies (HTTP vs HTTPS/CONNECT support), handle authentication and timeouts, blacklist bad proxies, and persist the rotation index atomically so concurrent runs do not pick the same entry.

Recommended Answers

All 3 Replies

I just need the code to use a proxy now

well... I've recently created a bot too but as I needed some fancy features I've created my own class and for proxy support used WebProxy class... there's also other classes to accomplish that (like GlobalProxySelection)...

if it comes to webBrowser control as far as I know it does not nativaly support proxies but as it somehow refer to Internet Explorer it supports its settings... in here you will find some more information and probably the solution you are looking for (check comments for the art):

Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.