My.Computer.Audio.Play(strAudioFilePath,AudioPlayMode.Background)什么是C#
等价代码是vb.net代码我想C#编写类似的代码。我试图在C#中转换此代码,但它不工作,有没有人有任何想法?
My.Computer.Audio.Play(strAudioFilePath,AudioPlayMode.Background)什么是C#
等价代码是vb.net代码我想C#编写类似的代码。我试图在C#中转换此代码,但它不工作,有没有人有任何想法?
SoundPlayer simpleSound = new SoundPlayer(strAudioFilePath);
simpleSound.Play();
MSDN链接到SoundPlayer类... http://msdn.microsoft.com/en-us/library/system.media.soundplayer。 aspx – 2009-08-06 05:28:16
您必须添加对Microsoft.VisualBasic的引用,才能得到与此类似的完全相同的代码。
Microsoft.VisualBasic.Devices.Audio audio = new Audio();
audio.Play(strAudioFilePath, AudioPlayMode.Background);
虽然有不涉及Audio
类的其他选项。
你试过Google吗? http://msdn.microsoft.com/en-us/library/4y171b18.aspx – zinovii 2009-08-06 05:25:40