I am making a multi-threaded application. Each thread has its own WebBrowser control. I want to know how to set a different proxy for each WebBrowser. A custom WebBrowser that supports a proxy per instance will be a good solution to me as well.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Since the WebBrowser is just an instance of the IE, it is impossible to set the Proxy for it. (Unless you tweak the registry, but it it's not individually)
Maybe another approach would be in order.
You could spawn a WebRequest in the background threads and set a different proxy for each one. After you receive the data, then you can easily load it in a WebBrowser to play with it.Using unmanaged code it can be achieved, it may help:
http://ryanfarley.com/blog/archive/2004/12/23/1330.aspx
As maor said, you won't be able to do a proxy per browser setup with WebBrowser. Instead, if you have control over the proxy, you might want to see what options it has for identifying a session (request/response). You might be able to, from the one proxy, tell which requests are probably coming from which WebBrowser controls depending on URLs and headers, etc.