【个人记录】c# webBrowers 如何获取所加载网页的图片地址

 1  private void button1_Click(object sender, EventArgs e)

 2         {

 3             HtmlElementCollection hec = this.webBrowser1.Document.Images;

 4             //MessageBox.Show(hec.Count.ToString());

 5             foreach (HtmlElement elem in hec)

 6             {

 7                 string elemName;

 8 

 9                 elemName = elem.GetAttribute("src");

10                 MessageBox.Show(elemName);

11 

12             }

13 

14         }

 

你可能感兴趣的:(Web)