Program.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Windows.Forms;
  6. namespace ToolsMPQ
  7. {
  8. static class Program
  9. {
  10. /// <summary>
  11. /// 应用程序的主入口点。
  12. /// </summary>
  13. [STAThread]
  14. static void Main(params string[] args)
  15. {
  16. if (args.Length > 0)
  17. {
  18. if (Directory.Exists(args[0]))
  19. {
  20. Application.EnableVisualStyles();
  21. Application.SetCompatibleTextRenderingDefault(false);
  22. Application.Run(new FormArchive(new DirectoryInfo(args[0])));
  23. return;
  24. }
  25. else if (File.Exists(args[0]) && args[0].ToLower().EndsWith(".mpq"))
  26. {
  27. Application.EnableVisualStyles();
  28. Application.SetCompatibleTextRenderingDefault(false);
  29. Application.Run(new FormUnarchive(new FileInfo(args[0])));
  30. return;
  31. }
  32. }
  33. Application.EnableVisualStyles();
  34. Application.SetCompatibleTextRenderingDefault(false);
  35. Application.Run(new FormMain());
  36. }
  37. }
  38. }