WPF中的Mediaplayer就是强大呀,只要有歌曲链接就能播放 [csharp] public partial class MainWindow : Window     {         MediaPlayer player = new MediaPlayer();         public MainWindow()         {             InitializeComponent();             MusicUrl.Text = "<a href="http://zhangmenshiting2.baidu.com/data2/music/5213846/5213846.mp3?xcode=f4ff3ed1ddf627aa674e52aa74965028&mid=0.66660684002912">http://zhangmenshiting2.baidu.com/data2/music/5213846/5213846.mp3?xcode=f4ff3ed1ddf627aa674e52aa74965028&mid=0.66660684002912</a>";         }         private void Button_Click(object sender, RoutedEventArgs e)         {             player.Open(new Uri(MusicUrl.Text.ToString()));             player.MediaOpened+=new EventHandler(player_MediaOpened);         }         private void player_MediaOpened(object sender, EventArgs e)         {             player.Play();         }     } [/csharp]

相关文章:

  • 2022-01-30
  • 2022-12-23
  • 2021-12-24
  • 2021-07-25
  • 2021-09-18
  • 2021-06-02
猜你喜欢
  • 2021-04-20
  • 2022-12-23
  • 2021-05-04
  • 2022-01-12
  • 2022-12-23
  • 2021-04-06
  • 2021-12-07
相关资源
相似解决方案