Click here to Skip to main content
15,917,473 members
Home / Discussions / C#
   

C#

 
GeneralRe: .Net version of depends? Pin
Russell Jones3-Mar-08 22:49
Russell Jones3-Mar-08 22:49 
Generaldatabind myTextbox.Text to myXmlElement.Value Pin
buchstaben3-Mar-08 4:42
buchstaben3-Mar-08 4:42 
QuestionGetManifestResource problem Pin
JustRonald3-Mar-08 4:36
JustRonald3-Mar-08 4:36 
GeneralRe: GetManifestResource problem Pin
led mike3-Mar-08 5:02
led mike3-Mar-08 5:02 
GeneralRe: GetManifestResource problem [modified] Pin
DaveyM693-Mar-08 6:07
professionalDaveyM693-Mar-08 6:07 
GeneralRe: GetManifestResource problem Pin
Giorgi Dalakishvili3-Mar-08 6:20
mentorGiorgi Dalakishvili3-Mar-08 6:20 
GeneralRe: GetManifestResource problem Pin
DaveyM693-Mar-08 8:51
professionalDaveyM693-Mar-08 8:51 
GeneralRe: GetManifestResource problem Pin
ADLER13-Mar-08 11:24
ADLER13-Mar-08 11:24 
Hi Ronald,
there are some ways to solve your problem:
1. you can distribute your wav file in a specific subfolder of your application, e.g. Sounds. Then you just set the filename variable to the following value:
string filename = Application.StartupPath + @"Sounds\attention.wav";
Don't forget to include using System.Windows.Forms. or type the namespace with the Application.StartupPath

2. You add the audio file as manifest into your exe. Then you need to call the following function:
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(Program), "attention.wav")
Note that you get a System.IO.Stream, so maybe need to save it in a temporary file and then call your PlaySound method (I don't know if your function supports a stream object as a parameter)


So, these are the ways, I retrieved quickly from my mind at 23:17 Smile | :) (German time)

PS: In the second solution I wrote typeof(Program). Program is a class generated by VisualStudio when you create a new project, so I used this here Smile | :)

I hope I could help you

_____________________________
The force of .NET is with me!

GeneralMonth and year control Pin
Yulianto.3-Mar-08 3:40
Yulianto.3-Mar-08 3:40 
GeneralRe: Month and year control Pin
Pete O'Hanlon3-Mar-08 3:46
mvePete O'Hanlon3-Mar-08 3:46 
GeneralRe: Month and year control Pin
Yulianto.3-Mar-08 3:49
Yulianto.3-Mar-08 3:49 
GeneralRe: Month and year control Pin
Pete O'Hanlon3-Mar-08 4:18
mvePete O'Hanlon3-Mar-08 4:18 
GeneralRe: Month and year control Pin
Yulianto.3-Mar-08 4:24
Yulianto.3-Mar-08 4:24 
GeneralRe: Month and year control Pin
Pete O'Hanlon3-Mar-08 5:04
mvePete O'Hanlon3-Mar-08 5:04 
GeneralRe: Month and year control Pin
PIEBALDconsult3-Mar-08 8:45
mvePIEBALDconsult3-Mar-08 8:45 
GeneralRetrieving text at a specific index from a text file Pin
jimmy2shoes3-Mar-08 3:21
jimmy2shoes3-Mar-08 3:21 
AnswerRe: Retrieving text at a specific index from a text file Pin
Eslam Afifi3-Mar-08 6:12
Eslam Afifi3-Mar-08 6:12 
Questionhow to add database fields dynamically to a crystal report in .net 2005 #1 Pin
Member 36683083-Mar-08 2:07
Member 36683083-Mar-08 2:07 
QuestionDatagridview, disable row selection Pin
alexander_perdum3-Mar-08 1:44
alexander_perdum3-Mar-08 1:44 
GeneralRe: Datagridview, disable row selection Pin
Xmen Real 3-Mar-08 4:51
professional Xmen Real 3-Mar-08 4:51 
GeneralRe: Datagridview, disable row selection Pin
alexander_perdum3-Mar-08 5:01
alexander_perdum3-Mar-08 5:01 
GeneralRe: Datagridview, disable row selection Pin
Xmen Real 3-Mar-08 5:12
professional Xmen Real 3-Mar-08 5:12 
GeneralRe: Datagridview, disable row selection Pin
alexander_perdum3-Mar-08 5:21
alexander_perdum3-Mar-08 5:21 
GeneralRe: Datagridview, disable row selection Pin
Xmen Real 3-Mar-08 5:26
professional Xmen Real 3-Mar-08 5:26 
GeneralRe: Datagridview, disable row selection Pin
alexander_perdum3-Mar-08 5:37
alexander_perdum3-Mar-08 5:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.