简体   繁体   中英

select files from setup location vb

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?

将文件添加到您的应用程序路径,以便可以使用以下命令:

  My.Computer.Audio.Play(Application.StartupPath & "\Sound_01.wav")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM