Advertisement
tankcr

backupITL

Apr 17th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 KB | None | 0 0
  1. using System;
  2. using iTunesLib;
  3. using System.Xml.Linq;
  4. using System.IO.Directory;
  5. using System.IO.SearchOption;
  6. using System.Collections.Generic;
  7.  
  8. namespace BackupLib
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             // iTunes classes
  15.             iTunesAppClass itunes = new iTunesAppClass();
  16.             IITLibraryPlaylist mainLibrary = itunes.LibraryPlaylist;
  17.             IITTrackCollection tracks = mainLibrary.Tracks;
  18.             List<string> files;
  19.             string[] extensions = {"*.mp3","*.mp4","*.m4a","*.m4p","*.m4v","*.m4b","*.flac"};
  20.             string filepath = "G:\\iTunes Media";
  21.             foreach (string extension in extensions)
  22.             {
  23.                 files.Add(System.IO.Directory.GetFiles(filepath, extension, SearchOption.AllDirectories));
  24.             }
  25.             XDocument doc = new XDocument(new XElement("body",
  26.                                                        new XElement("level1",
  27.                                                            new XElement("level2", "text"),
  28.                                                            new XElement("level2", "other text"))));
  29.             doc.Save("D:\\document.xml");
  30.  
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement