V
Vanessa
Anyone know how to embed sound file to vb.net project, then play the sound
file?
I have searched the web for example... and download the example and when
run, it works perfectly.
But when i try to insert a sound file (.wav) to my project and set the Build
Action to "Embedded Resources". And then I use the same code as what I saw
in the example, but it gives me an error,
An unhandled exception of type 'System.NullReferenceException' occurred in
Application.exe
Additional information: Object reference not set to an instance of an
object.
When i debug, it prompt an error at the if statement, when my mouse move
over to Str, it's nothing. Anybody knows what's wrong or what i did wrong?
Dim strNameSpace As String =
System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString()
Dim Str As Stream =
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(
strNameSpace + "." + wav)
if Str.CanRead Then
Regards
Vanessa
file?
I have searched the web for example... and download the example and when
run, it works perfectly.
But when i try to insert a sound file (.wav) to my project and set the Build
Action to "Embedded Resources". And then I use the same code as what I saw
in the example, but it gives me an error,
An unhandled exception of type 'System.NullReferenceException' occurred in
Application.exe
Additional information: Object reference not set to an instance of an
object.
When i debug, it prompt an error at the if statement, when my mouse move
over to Str, it's nothing. Anybody knows what's wrong or what i did wrong?
Dim strNameSpace As String =
System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString()
Dim Str As Stream =
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(
strNameSpace + "." + wav)
if Str.CanRead Then
Regards
Vanessa