Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 132,389 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,229 people online right now. Registration is fast and FREE... Join Now!




Help on how to put correct URL in accessing a file

 
Reply to this topicStart new topic

Help on how to put correct URL in accessing a file

kalabidong
post 23 Aug, 2008 - 09:16 AM
Post #1


New D.I.C Head

*
Joined: 23 Aug, 2008
Posts: 7

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..
User is offlineProfile CardPM

Go to the top of the page

gbertoli3
post 23 Aug, 2008 - 09:41 AM
Post #2


DIC at Heart + Code

Group Icon
Joined: 23 Jun, 2008
Posts: 1,026



Thanked 16 times

Dream Kudos: 950
My Contributions


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
User is offlineProfile CardPM

Go to the top of the page

kalabidong
post 25 Aug, 2008 - 06:55 AM
Post #3


New D.I.C Head

*
Joined: 23 Aug, 2008
Posts: 7

thanks for the help..

User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 07:02AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month