|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to launch media player and a selected file from within VB.Net app?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" <bduf***@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/> 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: Show quoteHide quote > "Bob" <bduf***@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/> <b**@datasync.com> schrieb:
> I notice your reply to the starting message uses "Process.Start" and Yes. However, you can open the file with a certain player too:> 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. \\\ Process.Start("C:\myplayer.exe", """C:\my files\sample.mp3""") /// > Is this "Process.Start" command Yes, it is.> now the equivalent of the Windows API "ShellExecute"?? -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> 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: Show quoteHide quote > <b**@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/> 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<b**@datasync.com> schreef in bericht Show quoteHide quote news:1150812871.475313.175750@y41g2000cwy.googlegroups.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: >> <b**@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/> > Myfile.wme? WME is Windows Media Encoder and a wme file is not a multimedia
file that WMP can play. Show quoteHide quote "Bob" <bduf***@sgiims.com> wrote in message news:%23latxz%23kGHA.4284@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 > > > You're right. I found the correct extension, works fine now.
Thanks Bob Show quoteHide quote "Mike Lowery" <selfspam@mouse-potato.com> wrote in message news:%23bukcXHlGHA.1000@TK2MSFTNGP04.phx.gbl... > Myfile.wme? WME is Windows Media Encoder and a wme file is not a > multimedia file that WMP can play. > > "Bob" <bduf***@sgiims.com> wrote in message > news:%23latxz%23kGHA.4284@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 >> >> >> > > |
|||||||||||||||||||||||