Program.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Configuration;
  3. using System.IO;
  4. using MediaBrowser.Controller;
  5. namespace MediaBrowser.Program
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. LoadKernel();
  12. }
  13. private static void LoadKernel()
  14. {
  15. DateTime now = DateTime.Now;
  16. Console.WriteLine("Loading");
  17. string installDir = ConfigurationManager.AppSettings["DataPath"];
  18. if (!Path.IsPathRooted(installDir))
  19. {
  20. string path = System.Reflection.Assembly.GetExecutingAssembly().Location;
  21. path = Path.GetDirectoryName(path);
  22. installDir = Path.Combine(path, installDir);
  23. installDir = Path.GetFullPath(installDir);
  24. }
  25. if (!Directory.Exists(installDir))
  26. {
  27. Directory.CreateDirectory(installDir);
  28. }
  29. Kernel kernel = new Kernel(installDir);
  30. kernel.Init();
  31. var time = DateTime.Now - now;
  32. Console.WriteLine("Done in " + time.TotalSeconds + " seconds");
  33. Console.WriteLine("Press Enter to quit.");
  34. Console.ReadLine();
  35. }
  36. }
  37. }