C#Youtube下载器

时间:2013-09-14 09:30:38

标签: c# youtube download

我必须为学校做项目,我需要以任何格式下载YouTube视频。 我试过这个

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;

 namespace Downloa
  {
    public partial class Form1 : Form
   {
      public Form1()
      {
        InitializeComponent();
      }

     private void button1_Click(object sender, EventArgs e)
     {
        WebClient client = new WebClient();
        client.DownloadFileCompleted += new AsyncCompletedEventHandler(completed);
        Uri adress = new Uri(textBox1.Text);
        client.DownloadFileAsync(adress, @"c:\video.flv");
    }

    private void completed(object sender, AsyncCompletedEventArgs e)
    {
        MessageBox.Show("Download completed");
    }
   }
  } 

但是当我尝试打开文件时,它说该文件不是视频。

1 个答案:

答案 0 :(得分:0)

我知道回答有点迟,但我正在寻找一些东西(不是4个相同的目的)并找到了这个。 http://www.codeproject.com/Tips/323771/YouTube-Downloader-Using-Csharp-NET 看看吧。