如果有新消息到达,请显示新消息通知 [英] If new message arrives, show new message notification
本文介绍了如果有新消息到达,请显示新消息通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
主题陈述了一切。我想在新消息进入时创建一个新的C#应用程序,它应播放声音以显示新消息已到达。有什么想法吗?
我的尝试:
i试图在C#中使用Soundplayer类并不像我预期的那样工作。
The subject states it all. I want to make a New C# application when a new Message comes in , it should play a sound to show a new Message has arrived. Any ideas?
What I have tried:
i have tried to use the Soundplayer Class in C# doesnt Work as i expected.
推荐答案
My.Computer.Audio.Play("C:\audio\sound.wav")
或
or
My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Beep)
textBox1.Text = openFileDialog1.FileName;
SoundPlayer player = new SoundPlayer();
player.SoundLocation = openFileDialog1.FileName;
player.Play();
}
System.Media.SystemSounds.Asterisk.Play();
尝试其中任何一个。
Try anyone of these.
这篇关于如果有新消息到达,请显示新消息通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文