public partial class Form1 : Form
{
private List<WebBrowser> browsers = new List<WebBrowser>();
public Form1()
{
InitializeComponent();
var wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
wb.Tag = 1;
wb.DocumentCompleted += this.wb_DocumentCompleted;
this.browsers.Add(wb);
this.tabPage1.Controls.Add(wb);
wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
wb.Tag = 2;
wb.DocumentCompleted += this.wb_DocumentCompleted;
this.browsers.Add(wb);
this.tabPage2.Controls.Add(wb);
}
private void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
var wb = (WebBrowser)sender;
Text = " i = [" + ((int)wb.Tag).ToString() + "]";
}
private void Form1_Load(object sender, EventArgs e)
{
var urls = new string[] { "http://w...content-available-to-author-only...a.org/", "http://m...content-available-to-author-only...i.com/wiki/" };
for (int i = 0; i < browsers.Count; i++)
{
browsers[i].Navigate(urls[i]);
}
}
}
ICAgIHB1YmxpYyBwYXJ0aWFsIGNsYXNzIEZvcm0xIDogRm9ybQogICAgewoKICAgICAgICBwcml2YXRlIExpc3Q8V2ViQnJvd3Nlcj4gYnJvd3NlcnMgPSBuZXcgTGlzdDxXZWJCcm93c2VyPigpOwoKICAgICAgICBwdWJsaWMgRm9ybTEoKQogICAgICAgIHsKICAgICAgICAgICAgSW5pdGlhbGl6ZUNvbXBvbmVudCgpOwogICAgICAgICAgICAKICAgICAgICAgICAgdmFyIHdiID0gbmV3IFdlYkJyb3dzZXIoKTsKICAgICAgICAgICAgd2IuRG9jayA9IERvY2tTdHlsZS5GaWxsOwogICAgICAgICAgICB3Yi5UYWcgPSAxOwogICAgICAgICAgICB3Yi5Eb2N1bWVudENvbXBsZXRlZCArPSB0aGlzLndiX0RvY3VtZW50Q29tcGxldGVkOwogICAgICAgICAgICB0aGlzLmJyb3dzZXJzLkFkZCh3Yik7CiAgICAgICAgICAgIHRoaXMudGFiUGFnZTEuQ29udHJvbHMuQWRkKHdiKTsKCiAgICAgICAgICAgIHdiID0gbmV3IFdlYkJyb3dzZXIoKTsKICAgICAgICAgICAgd2IuRG9jayA9IERvY2tTdHlsZS5GaWxsOwogICAgICAgICAgICB3Yi5UYWcgPSAyOwogICAgICAgICAgICB3Yi5Eb2N1bWVudENvbXBsZXRlZCArPSB0aGlzLndiX0RvY3VtZW50Q29tcGxldGVkOwogICAgICAgICAgICB0aGlzLmJyb3dzZXJzLkFkZCh3Yik7CiAgICAgICAgICAgIHRoaXMudGFiUGFnZTIuQ29udHJvbHMuQWRkKHdiKTsKICAgICAgICB9CgogICAgICAgIHByaXZhdGUgdm9pZCB3Yl9Eb2N1bWVudENvbXBsZXRlZChvYmplY3Qgc2VuZGVyLCBXZWJCcm93c2VyRG9jdW1lbnRDb21wbGV0ZWRFdmVudEFyZ3MgZSkKICAgICAgICB7CiAgICAgICAgICAgIHZhciB3YiA9IChXZWJCcm93c2VyKXNlbmRlcjsKICAgICAgICAgICAgVGV4dCA9ICIgaSA9IFsiICsgKChpbnQpd2IuVGFnKS5Ub1N0cmluZygpICsgIl0iOwogICAgICAgIH0KCiAgICAgICAgcHJpdmF0ZSB2b2lkIEZvcm0xX0xvYWQob2JqZWN0IHNlbmRlciwgRXZlbnRBcmdzIGUpCiAgICAgICAgewogICAgICAgICAgICB2YXIgdXJscyA9IG5ldyBzdHJpbmdbXSB7ICJodHRwOi8vdy4uLmNvbnRlbnQtYXZhaWxhYmxlLXRvLWF1dGhvci1vbmx5Li4uYS5vcmcvIiwgImh0dHA6Ly9tLi4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5pLmNvbS93aWtpLyIgfTsKCiAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgYnJvd3NlcnMuQ291bnQ7IGkrKykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgYnJvd3NlcnNbaV0uTmF2aWdhdGUodXJsc1tpXSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9