I have a Uri list that I want to click. To achieve this, I am trying to create a new Uri web browser control. I am creating a new thread for Uri. The problem I am facing is the end of the stream before the document is fully loaded, so I will never use the DocumentComplete event. How can I overcome this?
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); }
multithreading c # browser
Art W Nov 24 '10 at 17:41 2010-11-24 17:41
source share