开发者

Add file to Itunes com

开发者 https://www.devze.com 2023-01-02 17:30 出处:网络
I saw the post (Adding song to itunes with C# sdk/api) about this, but following the link couldn\'t find any solid help..

I saw the post (Adding song to itunes with C# sdk/api) about this, but following the link couldn't find any solid help.. Could some开发者_JAVA技巧one point me in the right direction? Thanks, Max


Interacting with iTunes in C# isn't all that bad.

Step 1 Add a project reference to the iTunes.exe file in your Program Files directory. This will add a reference to iTunesLib.

Step 2 Create a new iTunesLib.iTunesAppClass instance.

Step 3 Use the iTunesAppClass.LibraryPlaylist.AddFile() method.

To ensure you aren't adding a duplicate file, you would have to check in the LibraryPlaylist.Tracks property to see if the file is already there. It's got a get_ItemByName() method you could try. If all else fails, you can just loop through the tracks to see if it's there.

0

精彩评论

暂无评论...
验证码 换一张
取 消