Opening Windows media palyer

Hi,
The problem is i should be able to open windows media palyer programatically through a button when i click on the button.Is there any built in function available in C#...i am trying this in C# .NET CF 2.0.

can any ine help me out...

Thanks for reading..



Answer this question

Opening Windows media palyer

  • Kapil Kumar

    try to quoting the file name like this:

    p.StartInfo.Arguments = "\""+file.FileName+"\"";



  • Gary Harpin

    Pass it in the second parameter

    System.Diagnostics.Process.Start("\\Windows\\wmplayer.exe", "\"\\Storage Card\\music\\Author\\My music.mp3\"");

    You should place quotes around if there are spaces in the path



  • Indraneel

    Hi!

    I've problems opening the files. I always get the message that the file was not found I'm using FileDialog.FileName. That should give me the full path

  • Slowpoison

    shouldnt make any difference but you never know - even though WMP is stored in program files - never know perhaps in the future or whatever it could be changed so reference it with the Windows shortcut name : wmplayer

    its not of importance but was thinking for perhaps the long term :) Instead you may also want to make sure that the file exists before launching the process



  • YoK

    can u help me in..how can we pass a url for this media player to play a file if we open it like that...

    thanks for ur help..it worked (System.Diagnostics.Process.Start("\\Windows\\wmplayer.exe", "");)

  • Blanker

    You may try this:
    System.Diagnostics.Process.Start("\\Windows\\wmplayer.exe", "");



  • Opening Windows media palyer