QUOTE(kalabidong @ 23 Aug, 2008 - 10:16 AM)

I'm a noob in visual basic and I'm trying to make a project that makes a sound if you press a key. But the problem is, when I build it and put the .exe file into another pc, there is no sound playing. But if I debug it, it is working perfectly. Now, the question is: how do I put the correct URL in accessing a file?
here is my code:
CODE
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Select Case e.KeyCode
Case Keys.Z
AxWindowsMediaPlayer1.URL = "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\drum wavs\tom\1 mid tom.wav"
Case Keys.X
AxWindowsMediaPlayer12.URL = "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\drum wavs\tom\2 mid tom.wav"
End Select
End Sub
Thank You..
Your answer is simple.
All you have to do is change
CODE
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Select Case e.KeyCode
Case Keys.Z
AxWindowsMediaPlayer1.URL = "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\drum wavs\tom\1 mid tom.wav"
Case Keys.X
AxWindowsMediaPlayer12.URL = "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\drum wavs\tom\2 mid tom.wav"
End Select
End Sub
to
CODE
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Select Case e.KeyCode
Case Keys.Z
AxWindowsMediaPlayer1.URL = "http://www.yoursite.com/Sounds/1 mid tom.wav"
Case Keys.X
AxWindowsMediaPlayer12.URL = "http://www.yoursite.com/Sounds/2 mid tom.wav"
End Select
End Sub
Let me explain
The directory and file you are trying to find isn't on the user's computer. If it was then you could play it.
Hope this helps