473,511 Members | 16,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to remove all format of video file and flash file?

1 New Member
hi,

I am creating small application using c#.net.I removed all image tag using regular expression no I want to remove all video file and flash file also in source code of webpage.

so far I have tried this ...

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Net;
  11. using System.IO;
  12. using System.Collections;
  13. using System.Text.RegularExpressions;
  14.  
  15.  
  16. namespace WindowsFormsApplication5
  17. {
  18.     public partial class Form1 : Form
  19.     {
  20.         public Form1()
  21.         {
  22.             InitializeComponent();
  23.         }
  24.  
  25.         private void button1_Click(object sender, EventArgs e)
  26.         {
  27.             WebClient wb = new WebClient();
  28.             string storeDate;
  29.             storeDate = wb.DownloadString(textBox1.Text);               
  30.             MessageBox.Show(storeDate);
  31.             string content = Regex.Replace(storeDate, @"<img\s[^>]*>(?:\s*?</img>)?", string.Empty, RegexOptions.IgnoreCase);
  32.             string pattern = @"<img\s[^>]*>(?:\s*?</img>)?";
  33.             if (Regex.IsMatch(storeDate, pattern))
  34.             MessageBox.Show(" Image Found");
  35.             else
  36.             MessageBox.Show(" Image Not found");
  37.             MessageBox.Show(content);
  38.             string content1 = Regex.Replace(storeDate, @"file=(?<flashurl>http://[^/]+/(.*)flv)", string.Empty, RegexOptions.IgnoreCase);
  39.             string pattern1 = @"file=(?<flashurl>http://[^/]+/(.*)flv)";
  40.             if (Regex.IsMatch(storeDate, pattern1))
  41.                 MessageBox.Show(" Flash file Found");
  42.             else
  43.                 MessageBox.Show("Flash file Not found");
  44.             MessageBox.Show(content1);
  45.             string content2 = Regex.Replace(storeDate, @"[youtube.*[/youtube]", string.Empty, RegexOptions.IgnoreCase);
  46.             string pattern2 = @"[youtube.*[/youtube]";
  47.  
  48.             if (Regex.IsMatch(storeDate, pattern2))
  49.                 MessageBox.Show(" video Found");
  50.             else
  51.                 MessageBox.Show(" video Not found"); 
  52.             MessageBox.Show(content2);
  53.  
  54.         }
  55.  
  56.  
  57.     }
  58.  
  59. }
  60.  
Dec 11 '12 #1
1 2070
Rabbit
12,516 Recognized Expert Moderator MVP
So what problem are you having? Are you getting errors? What are they? Is it not doing what you want? What is it doing instead?
Dec 11 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1995
by: Juggernath | last post by:
I have upload form for uploading swf file and then I should get true dimensions of that flash. Any ideas how to do it?
2
1867
by: Bob | last post by:
How do I access a flash file in my .net web pages. I have worked with image files with no problem such as: in my header.ascx program, I have a: <IMG src= "images/header_gold2.jpg"> Then, in...
3
3052
by: sureshsundar007 | last post by:
Hi all, I want to know how to read the Flash file (.SWF) information using C#. Any help is greatly appreciated. Thanks, Suresh.
3
7801
by: yxq | last post by:
Hello, I use the com component "shockwave flash object" to play flash file, but how to get the actual size (width*height) of flash file but no control size? thank you!
12
2276
by: Sandman | last post by:
There are some Mac tools to convert pretty much any given video source to a Flash video file (.flv) but I'm wondering if there is any way to do it using a Linux platform tying in to a PHP web...
1
2388
by: patronise | last post by:
My problem is that I'm wrestling to make the LoadMovie and UnloadMovie functions work for me. Here is the layout of my flash file: I've got several seperate flash files and I can jump to any one of...
0
1409
shane3341436
by: shane3341436 | last post by:
Hello to all I have a very strange problem while loading swf flash file in my php page. The swf file loads well under localhost and IE7 browser. But when viewed using IE6 or mozilla only the first...
0
1009
YallowPants
by: YallowPants | last post by:
hi all i found good prog for converting all video (avi, mpg, mpeg, wmv, mov, asf, mp4, etc.) formats into flash(swf,flv) its FlashConv! this is very simple tool for making high-quality flash file!...
1
2788
by: David Buckley | last post by:
Does anyone have any example code of converting any type of video to flash video at all using asp.net 2.0 c# web applications. God Bless
1
3281
by: premMS143 | last post by:
Hi everybody, I've created a VB form which display a menu showing different contents. Clicking on any content should display a file which is in flash (.swf) format. But I don't have an idea about...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.