简体   繁体   中英

Open media player when clicked on an MP3 file

How to develop a media player which opens up and plays song when an MP3 file is opened. Just like in our OS when you click on MP3 file Windows media player opens up and plays song.

In my application how to handle this functionality.

To open your app when double clicking on a mp3: use the registry or "Right click mp3, open with, and select your application"

To play the MP3 in your app: You will get the filepath as the first parameter of your 'main' function.

class Program
{
    static void Main(string[] args)
    {
       if (args != null)
       {
         String filePath = args[0];
         SomeForm frm = new SomeForm(filePath );
       }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM