C#、VB.NET 使用System.Media.SoundPlayer播放音乐
生活随笔
收集整理的這篇文章主要介紹了
C#、VB.NET 使用System.Media.SoundPlayer播放音乐
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
原文:C#、VB.NET 使用System.Media.SoundPlayer播放音樂
?同步播放:
System.Media.SoundPlayer player = new System.Media.SoundPlayer(); player.SoundLocation = @"d:/music/happy.wav"; player.Load(); player.Play();異步播放:
System.Media.SoundPlayer player = new System.Media.SoundPlayer(); player.SoundLocation = @"d:/music/happy.wav"; player.LoadAsync(); player.PlaySync();循環(huán)播放:
System.Media.SoundPlayer player = new System.Media.SoundPlayer(); player.SoundLocation = @"d:/music/happy.wav"; player.Load(); player.PlayLooping();總結
以上是生活随笔為你收集整理的C#、VB.NET 使用System.Media.SoundPlayer播放音乐的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 虚拟座谈会:有关分布式存储的三个基本问题
- 下一篇: 深入理解javascript原型链