473,378 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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

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

Jun 19 '06 #1
7 5212
"Bob" <bd*****@sgiims.com> schrieb:
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")
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jun 19 '06 #2
bob
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.
Herfried K. Wagner [MVP] wrote:
"Bob" <bd*****@sgiims.com> schrieb:
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")
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Jun 20 '06 #3
<bo*@datasync.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Jun 20 '06 #4
bob
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!)
Herfried K. Wagner [MVP] wrote:
<bo*@datasync.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Jun 20 '06 #5
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

<bo*@datasync.com> schreef in bericht
news:11**********************@y41g2000cwy.googlegr oups.com...
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!)
Herfried K. Wagner [MVP] wrote:
<bo*@datasync.com> schrieb:
> 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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jun 20 '06 #6
Myfile.wme? WME is Windows Media Encoder and a wme file is not a multimedia
file that WMP can play.

"Bob" <bd*****@sgiims.com> wrote in message
news:%2******************@TK2MSFTNGP05.phx.gbl...
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

Jun 20 '06 #7
Bob
You're right. I found the correct extension, works fine now.
Thanks
Bob
"Mike Lowery" <se******@mouse-potato.com> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Myfile.wme? WME is Windows Media Encoder and a wme file is not a
multimedia file that WMP can play.

"Bob" <bd*****@sgiims.com> wrote in message
news:%2******************@TK2MSFTNGP05.phx.gbl...
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


Jun 22 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Charles A. Lackman | last post by:
Hello, I have a web site that plays mp3's and wav files, I am using a media player on the site which does not allow for downloading the media, but if you go to properties within the player and...
3
by: rmorvay | last post by:
I wrote a quick app to play music and I am having difficulty connecting a slider control to the Windows Media Player control. Here is my difficulty. I need to set the sliders min and max properties...
3
by: UJ | last post by:
I have a .avi file that uses the Divx codec. If I load it with windows media player program it works fine. If I load it using my control in a program, it doesn't display. Over standard media files...
2
by: benmourra | last post by:
Hi all, I'm trying to create a web page using VS2005, ASP.NET 2.0, that will allow me to choose from a list of media files on my computer and then play my selection within an embedded Windows...
1
by: sri2097 | last post by:
Basically, I want to check if a URL is playable or not (without actually playing it). i.e. given a URL I want to write an automation script to figure it out for me if it's playable or not. If...
19
by: Tony | last post by:
I'm working on project that plays movies using Windows Media Player and I'm controlling everything with JavaScript. Per the client I only need to support IE 6 or greater which happens to make...
3
by: Ronald S. Cook | last post by:
In my Win app, I'm needing to load a media file into my Windows Media Player control, and THEN read an attribute from the file. The thing is, the file has to be playing for a split second before...
2
riptide2049
by: riptide2049 | last post by:
I really have a problem here. I have a code that is suppost to take the href of a link from the right class;value of a link maked toreturn false. the value is a Media file the file is sent to...
5
by: Fred Chateau | last post by:
I am currently using an Object element of type "application/x-mplayer2" to create a media player in ASP.NET 3.5, and was wondering if there is a better way to instantiate WMP in a browser. I'm...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.