简单的音乐播放器代码 [英] simple music player code
本文介绍了简单的音乐播放器代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试过;
sir i try;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace ConsoleApplication1
{
class Program
{
static void Main()
{
SoundPlayer sa = new SoundPlayer();
sa.Play(@"C:\Users\TRAX\Documents\MEMORYCARD\OhAyatai1.wav");
}
}
}
但是音乐无法播放.帮助我纠正此代码.
however music does not play. Help me to correct this code.
推荐答案
尝试以下操作:
Try the following :
System.Media.SoundPlayer sp = new System.Media.SoundPlayer(@"C:\Users\TRAX\Documents\MEMORYCARD\OhAyatai1.wav");
sp.Play();
这篇关于简单的音乐播放器代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文