2010-03-05 69 views
0
   string host = "http://youtube.com/v/"; 
     string end = ".flv"; 
     WebClient Client = new WebClient(); 
     StreamReader sr = new StreamReader(@"ids.txt"); 
     string line; 
     do 
     { 
     line = sr.ReadLine(); 
     Client.DownloadFile(host+line+end,line+end); 

     } 
     while (line !=null); 
     sr.Close(); 

工作正常,但比我晚應運行FLV /視頻這給了我這個錯誤>影片下載

An error occurred when the file plays in Windows Media Player 

爲什麼,我在做什麼錯?

+0

那麼ids.txt文件中究竟有什麼內容? – joedotnot 2010-03-12 00:57:07

+0

GOM Player是另一個不錯的嘗試!我個人喜歡左箭頭和右箭頭功能一次快進或快退5秒! – 2014-04-21 01:47:47

回答

5

這是一個FLV(Flash視頻)文件。並非所有Windows Media Player版本都可以播放FLV文件。如果您沒有正確設置,您需要一個FLV player。要在WMP中播放它,你可以嘗試:WMP FLV Playing

+1

或者使用VLC播放器,它可以播放大量的文件格式,包括FLV,如果沒有太多的努力安裝它。 – Pindatjuh 2010-03-05 15:50:25

1

VLC(http://www.videolan.org/vlc/)在播放幾乎所有東西方面也做得很好。

作爲額外的獎勵,你可以開始觀看,同時下載過程中,因爲VLC不試圖鎖定文件

1

您需要使用一個FLV播放器。默認情況下,Windows Media Player將不播放FLV文件。

我自己並沒有嘗試過這種方法,並且基於快速谷歌搜索,但如果您絕對需要使用Windows Media Player,則可以嘗試安裝FLV編解碼器(只需搜索谷歌即可找到一些)。我相信VLC也會播放FLV。