Reputation: 31
I work on my VB application on visual studio 2012 I created a button, On clicking it, it plays a file on my PC ("D:\My Project\Sound_01.wav") so the code will be like that:
**Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
My.Computer.Audio.Play("D:\My Project\Sound_01.wav")
End Sub**
My problem is that I need to make setup file for that app (using install shield 2015) and the file location will return error because the destination PC may not have the same location("D:\My Project\Sound_01.wav")
can anyone advise me how to do that?
Upvotes: 0
Views: 65
Reputation: 446
add the file to your application path so you can use following:
My.Computer.Audio.Play(Application.StartupPath & "\Sound_01.wav")
Upvotes: 1