多个帐户,以一个网站应用程序

多个帐户,以一个网站应用程序

问题描述:

我用C#编写的WindowsForms应用程序,启动多个线程对一个网站不同的用户帐户登录。我使用WebBrowser控件的登录页面导航到主页。

I have an WindowsForms application written in C# which starts a number of threads for logging in on a site with different users' accounts. I use a WebBrowser control to navigate from the login page to the main page.

我的问题是我只能用一个用户帐户进行身份验证,所有线程都连接到同一个帐户,因为该网站使用Cookie来存储会话ID。我怎么可以存储多个会话,从不同的浏览器模拟验证?

My problem is I can only authenticate with one user account, all threads are connected to the same account because the site uses cookies to store a sessionID. How can I store multiple sessions to simulate the authentication from different browsers?

任何建议,欢迎。

这是因为现有的会话合并政策present在Internet Explorer不可能的 - web浏览器是IE的模拟层,所以它遵循同一个原则。一个良好的阅读的话题是可用的这里

It is not possible because of existing session merging policies present in Internet Explorer - WebBrowser is the IE's emulation layer, so it abides to the same principles. A good read on the topic is available here.

要去解决这个问题,你将不得不进一步去比单纯使用的控制,而是访问IE浏览器在一个较低的水平。

To go around this issue, you will have to go further than simply using the control, but rather access IE on a lower level.