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