检查是否使用vb.net在网站中嵌入了flash(swf)文件 [英] check if a flash(swf) file is embedded in the website using vb.net

查看:104
本文介绍了检查是否使用vb.net在网站中嵌入了flash(swf)文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这是我在任何地方的第一篇文章。我们有什么方法可以检查Flash图像或视频是否嵌入到网站中。



我在Windows窗体中使用了WebBrowser并添加了它我希望得到网页中所有图像,视频链接和闪光的数量。

i能够获得图像和视频链接的数量。但不能捕获是否存在闪存。

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.

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.

推荐答案

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.


这篇关于检查是否使用vb.net在网站中嵌入了flash(swf)文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆