











using System.Reflection; using System.IO; using System.Resources; using System.Media; using System.Diagnostics; namespace CN.OutOfMemory.Csharp { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Assembly assembly; Stream soundStream; SoundPlayer sp; assembly = Assembly.GetExecutingAssembly(); sp = new SoundPlayer(assembly.GetManifestResourceStream("Yournamespace.Dreamer.wav")); sp.Play(); } } } /*SoundPlayer sp = new SoundPlayer(global::WindowsApplication1.Properties.Resources.yoursoundfilename); */
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。