473,507 Members | 2,472 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 2069
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
1863
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
3050
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
7799
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
1407
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
1008
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
7223
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
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
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
7034
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...
1
5045
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
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
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
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.