📅  最后修改于: 2022-03-11 14:49:18.200000             🧑  作者: Mango
static void browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
WebBrowser browser = (WebBrowser)sender;
HtmlElementCollection collection;
List imgListString = new List();
if (browser != null)
{
if (browser.Document != null)
{
collection = browser.Document.GetElementsByTagName("img");
if (collection != null)
{
foreach (HtmlElement element in collection)
{
WebClient wClient = new WebClient();
string urlDownload = element.GetAttribute("src");
wClient.DownloadFile(urlDownload, urlDownload.Substring(urlDownload.LastIndexOf('/')));
}
}
}
}
}