Question

Is this possible to make an application that allows us to make an application that has 4 web browser controls and we can independently use each browser control for different Login on same website.

Lets say i have one web browser dealing with hotmail with Office Email where as Second web browser control dealing with hotmail with Personal Email

Currently i have searched that web browser cannot have different PROXIES or USER-Agent Strings.

Any Solutions?

Was it helpful?

Solution

Moving my comments as an answer.

Authentication is tied to an auth ticket. Find out how is the ticket sent to the service (cookie, url, form) and apply it to your controls.

URL and form auth should work right away without any changes - I see these used a lot in PHP apps.
Maybe setting that you do not accept cookies will force this mode - if the service supports automatic auth mode switching (eg. WebForms with cookieless="AutoDetect").

Otherwise try webBrowser.Document.Cookie to change the auth cookies - this works out of the box with WinForms.

You need to cast the Document and add reference to the COM "Microsoft HTML Object Library" in WPF:

string cookie = (webBrowser.Document as mshtml.IHTMLDocument2).cookie;

You can also try doing web requests manually with CookieContainer and use the WebBrowser control only for visualization. You should probably read some pages on authentication.

Basically you need to send different cookies to different services.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top