Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

this is my code:

 

System.Diagnostics.Process.Start("wmplayer.exe", "Help Me.mp3")

 

it opens Windows Media Player, but the song doesn;t start. I haver the song located in the Bin Folder. Any One Know how to get the song to play?

  • Leaders
Posted
You have to supply the whole path to file... it won't look in the Bin folder for the file. And then, you have to make sure that the path doesn't have any spaces. (filenames with ~#)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

  • Leaders
Posted

What I'm saying is that, when you pass the filename into it like that, the Windows Media Player is going to receive just the filename: "Help Me.mp3"... and it will try to run it... but WMP is running from some other distant folder on the computer (Program Files\Windows Media Player) and when it sees that filename, it probably won't have a clue as to where that file is, unless (maybe) you have it already in your Windows Media Player Library... and I think WMP is smart enough to know where the file is since it has already found it before.

But, that's just a guess... :-\

you may want to look at the [api]GetShortPathName[/api] API, and Environment.CurrentDirectory to get a path name for your song. :)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted

System.Diagnostics.Process.Start("wmplayer.exe", System.Environment.CurrentDirectory & "Help Me.mp3")

 

:)

This is only a test of the emergency broadcast system

This is a product of hysterical mass confusion

A ship of fools adrift on the sea of our pollution

Rudderless and powerless on the sea of our delusion

pennywise - this is only a test

  • Leaders
Posted

That's because WMP9 is treating the spaces that occur in your filename to be separating the arguments.

 

Try making the path to your file like this.

 

System.Diagnostics.Process.Start("wmplayer.exe", "C:\docume~1\talk2t~1\mydocu~1\visual~1\etc~1\HelpMe~1.mp3")

:)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...