My.Computer.Audio.Play(strAudioFilePath, AudioPlayMode.Background)
这是 vb.net 代码,我想用 C# 编写类似的代码。我尝试在 C# 中转换此代码,但它不起作用,有人知道吗?
最佳答案
SoundPlayer simpleSound = new SoundPlayer(strAudioFilePath);
simpleSound.Play();
关于c# - c#中的等效代码是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1237090/