Access the Windows Media Player library C#

邮差的信 提交于 2019-12-02 08:09:07

问题


I am trying to find out how to access the Windows Media Player library in c#. I have had a look around the web and SO and have found many articles on controlling WMP. I am trying to access its library information however. I.e. its track names, file path and metadata.

Is there a library for this or at least does it store it in some form of database somewhere?

Thanks, Ben


回答1:


Create a windows form and place a WMP component on it, named WMPLayer:

AxWMPLib.AxWindowsMediaPlayer Player = form.WMPlayer;
WMPLib.IWMPPlaylist mediaPlaylist = Player.mediaCollection.getByAttribute("MediaType", "audio"); //Get the audio medias.

Fill in different parameters in getByAttribte to get what you want.



来源:https://stackoverflow.com/questions/5163668/access-the-windows-media-player-library-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!