c# - c#中的等效代码是什么

标签 c#

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/

相关文章:

C# XNA : Looking for a function like MathHelper. 钳位

c# - 如何将数据库大小从兆字节转换为字节,反之亦然?

c# - 以编程方式重命名计算机

c# - 一个 Web API Controller 来控制所有模型

c# - 对字符串列表(门牌号)进行排序

c# - 同一台 Windows 机器上的串行端口通信无法正常工作

c# - Xamarin-MediaPlugin保存到相册在iOS下不起作用

c# - 我如何在同一个程序/应用程序中重新打开 WPF 窗口?

c# - ServiceStack - 尝试解析服务 {X} 或其 Autowiring 的依赖项之一时出错

c# 禁用 Trackbar 上的 ScrollWheel