Hi since i been playing with the web broswer control in C# for a few days, I made this little sniplet of code that can allow you to fill a listbox with images from a selected page.
First add a command button and name it cmdGo Add a listbox controls to the form keep the default name.
then add this code into the click event of the command button.
Next add webBrowser control to your form keep the default name and in the webBrowser1_DocumentCompleted event add the code bwlow:Code://Navigate to a site of your choice webBrowser1.Navigate("http://www.google.co.uk/");
Well that really it click the button and you see the links in the listbox. Maybe you can update it to make your own image downloader. Hope you found this sniplet usfull.Code://Wait till the whole page as finished downloading if (e.Url.AbsolutePath != (sender as WebBrowser).Url.AbsolutePath) { return; } //Page finished foreach (HtmlElement iImg in webBrowser1.Document.Images) { //Fill a Listbox with the image urls listBox1.Items.Add(iImg.GetAttribute("src")); }




Reply With Quote