网站应用程序的多个帐户
我有一个用 C# 编写的 WindowsForms 应用程序,它启动多个线程,用于使用不同用户的帐户登录网站。我使用 WebBrowser 控件从登录页面导航到主页。
我的问题是我只能使用一个用户帐户进行身份验证,所有线程都连接到同一帐户,因为该站点使用 cookie 来存储 sessionID。如何存储多个会话来模拟来自不同浏览器的身份验证?
欢迎任何建议。
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.
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?
Any suggestions are welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是不可能的,因为 Internet Explorer 中存在现有的会话合并策略 - WebBrowser 是 IE 的模拟层,因此它遵循相同的原则。可以阅读有关该主题的好文章 这里。
要解决此问题,您需要比简单地使用控件更进一步,而是在较低级别上访问 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.
To go around this issue, you will have to go further than simply using the control, but rather access IE on a lower level.