Click here to Skip to main content
13,295,243 members (70,070 online)
Rate this:
Please Sign up or sign in to vote.
See more:
This is my first post in any place. is there any way we can check if the flash image or videos are embedded in the website.
I have used WebBrowser in the windows forms and have added it and i want to get the count of all the images, video links and flash in the web page.
i am able to get the count of images and video links. but cant capture if there is a flash present or not.
Posted 23-Jan-13 22:43pm
Updated 23-Jan-13 22:57pm
Logi Guna 24-Jan-13 11:41am
see my edited answer, added emded tag searching

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Dim elements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("object")
For Each element As HtmlElement In elements
    ' "CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" is clsid for SWFObject
    ' clsid was confirmed here:
    Dim attr As String = element.GetAttribute("classid")
    If "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000".Equals(attr, StringComparison.OrdinalIgnoreCase) Then
MessageBox.Show("SWF Object found")
    End If
' Now search for embed tag
elements = WebBrowser1.Document.GetElementsByTagName("embed")
For Each element As HtmlElement In elements
    If element.OuterHtml.IndexOf("application/x-shockwave-flash", StringComparison.OrdinalIgnoreCase) >= 0 Then
MessageBox.Show("Embedded SWF found")
    End If

Hope this helps.
Manu_vish 27-Jan-13 23:42pm
Thank you very much. this was really helpful.
I was able to get the flash file details. do you know is there some thing like this for videos also. because i created for one site where the videos links are in button. but that is not working in few as they are embedded as links to few words like"Click here to Watch","Get More Details" the words will change
Manu_vish 28-Jan-13 0:29am
i will just reject the solution to get the answer for the next part of getting video links. but this solution worked great thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171207.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100