i have created an audio player using the wmp control. all was going well untill i found out that i couldnt play a song so i had to manually enter the url in the code behind the program. this caused a problem as i cant now distribute the program as it will only work on my laptop can any one help on how to get the program to work without manual url's or by searching the users pc for the file instantly any help is appreciated.
The code is
VB Code:
Private Sub Dir1_Change() File1.Path = Dir1.Path End Sub Private Sub Drive1_Change() On Error GoTo DriveHandler If Drive1Drive = d Then MsgBox "Make Sure A Disc Is Inserted. (If there is a disc in the drive ignore this message.)" Dir1.Path = Drive1.Drive Exit Sub DriveHandler: Drive1.Drive = Dir1.Path Exit Sub End Sub Private Sub File1_Click() If File1.FileName = "Who The ***** Are Arctic Monkeys.mp3" Then WindowsMediaPlayer1.URL = "C:\Documents and Settings\Connah\My Documents\Music\Arctic Monkeys\Other\Who The ***** Are Arctic Monkeys.mp3" End Sub
A print screen is attached[IMG]J:\vb screen.JPG[/IMG] http://J:\vb screen.JPG
sorry if the links dont work but i think the code should be enough




Reply With Quote