how to launch media player and a selected file from within VB.Net app?

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I have a media file Myfile.wme that I want to play within the Windows
default media player on a button or menu click event in my app. The file is
in a folder relative to my bin folder. I can defeine the full path of the
file then using that I want to launch the media player to use that file.

Any help greatly appreciated.

Bob
 
Bob said:
I have a media file Myfile.wme that I want to play within the Windows
default media player on a button or menu click event in my app. The file
is in a folder relative to my bin folder. I can defeine the full path of
the file then using that I want to launch the media player to use that
file.

\\\
Imports System.Diagnostics
....
Process.Start("C:\foo\bla.wmv")
///
 
Hi,

I notice your reply to the starting message uses "Process.Start" and
only names the target file to be played, without naming the program to
play it with. Obviously, this depends on the "Type" of file (wmv) being
assigned a hosting program in Windows. Is this "Process.Start" command
now the equivalent of the Windows API "ShellExecute"??

Thanks.
 
I notice your reply to the starting message uses "Process.Start" and
only names the target file to be played, without naming the program to
play it with. Obviously, this depends on the "Type" of file (wmv) being
assigned a hosting program in Windows.

Yes. However, you can open the file with a certain player too:

\\\
Process.Start("C:\myplayer.exe", """C:\my files\sample.mp3""")
///
Is this "Process.Start" command
now the equivalent of the Windows API "ShellExecute"??

Yes, it is.
 
Thanks. (I'm slowly eliminating all the "declares" I had in vb6,
replacing them with cleaner, quicker vb.net stuff. Every time I do
that, it makes me feel a little better about .net. Before long, I'm
going to be loving this language!)
 
Myfile.wme? WME is Windows Media Encoder and a wme file is not a multimedia
file that WMP can play.
 
Bob,

You are not the first one who does that and have the same evolution in that.

Although version 2005 has a lot of failures especial in the IDE, but that is
known and we are sure that it will be solved. Our expiriences from 2002 to
2003 version (in fact almost an SP) were great.

:-)

Cor

Thanks. (I'm slowly eliminating all the "declares" I had in vb6,
replacing them with cleaner, quicker vb.net stuff. Every time I do
that, it makes me feel a little better about .net. Before long, I'm
going to be loving this language!)
 
Back
Top