新线程中的WebBrowser控件
var item = new ParameterizedThreadStart(ClicIt.Click); var thread = new Thread(item) {Name = "ClickThread"}; thread.Start(uriItem); public static void Click(object o){ var url = ((UriItem)o); Console.WriteLine(@"Clicking: " + url.Link); var clicker = new WebBrowser { ScriptErrorsSuppressed = true }; clicker.DocumentCompleted += BrowseComplete; if (String.IsNullOrEmpty(url.Link)) return; if (url.Link.Equals("about:blank")) return; if (!url.Link.StartsWith("http://") && !url.Link.StartsWith("https://")) url.Link = "http://" + url.Link; clicker.Navigate(url.Link);}
ABOUTYOU