-1

Ok, so a program I am making involves using multiple webbrowsers with different cookies. It logs into the same site on several accounts. However, to log into several sites I need multiple webbrowsers running the same function, but I want this program to be able to log into as many accounts as needed, so I need to generate a webbrowser basically. Instead of putting it in the form, I need a code that generates a webbrowser on the form. Is this even possible?

4

3 回答 3

1

您可以使用Load窗体的事件来创建new WebBrowser()控件并将Add它们添加到窗体的Controls集合中。

但是,不必为了使用它们而将它们添加到表单中。

网络浏览器:MSDN

于 2013-07-20T23:32:57.257 回答
1

您可以动态创建许多 WebBrowser,但它不会按照您想要的方式工作。每个 WebBrowser 都将充当 Internet Explorer 的单独选项卡。有关更多信息,您可以查看以下内容。

在一个窗口中托管多个 WebBrowser 控件会导致会话“交叉”:有什么解决方案吗?.

于 2013-07-20T23:51:17.413 回答
0

使用 tabcontrol 并将每个 webbrowser 放在单独的 tabpage 中。您可以使用网络浏览器轻松声明标签页,并根据需要添加或删除标签页。由于网络浏览器加载的每个文档都有自己的 cookie 集合,并且网站是您自己的,因此您应该能够将您的网站设置为接受来自同一台机器的多个用户,至少暂时用于测试。

于 2013-07-21T00:30:26.440 回答