日期:2014-05-18 浏览次数:20833 次
int i = 0; private void button1_Click_1(object sender, EventArgs e) { i = 0; BrowseDropdownlistItem(); } private void BrowseDropdownlistItem() { if (i < comboBox1.Items.Count) { string url = comboBox1.Items[i].ToString(); webBrowser1.Navigate(url); } } private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { //避免webbroswer.DocumentCompleted被多次引发 if ((e.Url != webBrowser1.Url) || (webBrowser1.ReadyState != WebBrowserReadyState.Complete)) return; //下面写你要在页面加载完毕后执行的代码。 i++; BrowseDropdownlistItem(); }