using System; using System.IO; namespace Jon.Galloway.Wrote.This { class OpenPlsInWM { [STAThread] static void Main(string[] args) { if (args.GetUpperBound(0) > -1) { string filename = args[0]; using (StreamReader sr = new StreamReader(filename)) { string line; while ((line = sr.ReadLine()) != null) { if (line.ToLower().StartsWith("file1=")) { string url = line.Split('=')[1]; System.Diagnostics.Process.Start("wmplayer.exe",url); break; } } } } else { Console.WriteLine("Usage: OpenPlsInWM \"playlist.pls\""); Console.WriteLine("Associate PLS file extension with this application to allow Windows Media Player to play them."); } } static void log(string text) { using (StreamWriter sw = File.AppendText(@"c:\utils\log.txt")) { sw.WriteLine(text); } } } }