Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Flash VB.NET
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 23-Jan-13 21:43pm
Edited 23-Jan-13 21:57pm
v2
Comments
Logi Guna at 24-Jan-13 11:41am
   
see my edited answer, added emded tag searching

1 solution

Rate this: bad
good
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: 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.
  Permalink  
v2
Comments
Manu_vish at 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 at 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
0 OriginalGriff 439
1 ChintanShukla 310
2 Gihan Liyanage 298
3 RyanDev 250
4 Richard Deeming 220
0 Sergey Alexandrovich Kryukov 8,906
1 OriginalGriff 7,771
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2014
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