开发者

C# application for Multiple user Login on same Site

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜