visual studio c# resource question

T

Tony

i'm new to c# & .net and I have a question: How do I attach a wav
resource to a form (or to a seperate .rc file) and get the resource
identifier so I can use the playsound api?

its a simple request but it seems really obtuse in the visual studio ide.

thanks!
 
D

Dmitriy Lapshin [C# / .NET MVP]

1. Add the WAV file to the project
2. Set its Build Action to 'Embedded Resource' in the IDE's Properties
window
3. Build the project and examine the resultant assembly with ILDASM.exe to
figure out the manifest resource name.
4. Use Assembly.GetManifestResourceStream to load the file into memory.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top