Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,
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.
[Edit]
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
Updated 23-Jan-13 21:57pm
v2
Comments
Logi Guna 24-Jan-13 11:41am    
see my edited answer, added emded tag searching

1 solution

VB
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: http://helpx.adobe.com/flash/kb/object-tag-syntax-flash-professional.html
    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
Next
' 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
Next


Hope this helps.
 
Share this answer
 
v2
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900