ASP. NET adds the sound file to the resource and plays the file.
This example describes how to add a sound file to a resource and play it back in ASP. NET. Share it with you for your reference. The details are as follows:
1. Add resources as follows:
2. Form2.cs is as follows:
/// Any source code blocks look like this // using System. reflection; using System. IO; using System. resources; using System. media; using System. diagnostics; namespace Yournamespace {public partial class Form2: Form {public Form2 () {InitializeComponent ();} private void Form2_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 );*/
I hope this article will help you design your asp.net program.