Program.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Runtime.InteropServices;
  2. namespace PictureMover
  3. {
  4. internal static class Program
  5. {
  6. internal static string[] CommandLineArgs { get; private set; }
  7. [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
  8. static extern bool FreeConsole();
  9. /// <summary>
  10. /// The main entry point for the application.
  11. /// </summary>
  12. [STAThread]
  13. private static void Main(string[] args)
  14. {
  15. if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") != "Development")
  16. {
  17. try
  18. {
  19. FreeConsole();
  20. }
  21. catch
  22. {
  23. //brr
  24. }
  25. }
  26. CommandLineArgs = args;
  27. // To customize application configuration such as set high DPI settings or default font,
  28. // see https://aka.ms/applicationconfiguration.
  29. ApplicationConfiguration.Initialize();
  30. Application.Run(new MainForm());
  31. }
  32. }
  33. }