25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

71 lines
2.7 KiB

  1. using System;
  2. using System.Reflection;
  3. using Microsoft.AspNetCore;
  4. using Microsoft.AspNetCore.Hosting;
  5. namespace MQTTnet.Server
  6. {
  7. public static class Program
  8. {
  9. public static int Main(string[] args)
  10. {
  11. try
  12. {
  13. PrintLogo();
  14. WebHost.CreateDefaultBuilder(args).UseStartup<Startup>().Build().Run();
  15. return 0;
  16. }
  17. catch (Exception exception)
  18. {
  19. Console.WriteLine(exception);
  20. return -1;
  21. }
  22. }
  23. private static void PrintLogo()
  24. {
  25. Console.ResetColor();
  26. Console.ForegroundColor = ConsoleColor.White;
  27. Console.BackgroundColor = ConsoleColor.Red;
  28. const string LogoText =
  29. @"| |
  30. | __ __ ____ _______ _______ _ _____ |
  31. | | \/ |/ __ \__ __|__ __| | | / ____| |
  32. | | \ / | | | | | | | |_ __ ___| |_ | (___ ___ _ ____ _____ _ __ |
  33. | | |\/| | | | | | | | | '_ \ / _ \ __| \___ \ / _ \ '__\ \ / / _ \ '__| |
  34. | | | | | |__| | | | | | | | | __/ |_ ____) | __/ | \ V / __/ | |
  35. | |_| |_|\___\_\ |_| |_|_| |_|\___|\__| |_____/ \___|_| \_/ \___|_| |
  36. | |
  37. | |";
  38. Console.WriteLine(LogoText);
  39. Console.ResetColor();
  40. Console.WriteLine();
  41. Console.ForegroundColor = ConsoleColor.White;
  42. Console.WriteLine(@"
  43. -- The official MQTT server implementation of MQTTnet --
  44. Copyright (c) 2017-2019 The MQTTnet Team");
  45. Console.ForegroundColor = ConsoleColor.Blue;
  46. Console.WriteLine(@"
  47. https://github.com/chkr1011/MQTTnet");
  48. Console.ForegroundColor = ConsoleColor.White;
  49. Console.WriteLine($@"
  50. Version: {Assembly.GetExecutingAssembly().GetName().Version}
  51. License: MIT (read LICENSE file)
  52. Sponsoring: https://opencollective.com/mqttnet
  53. Support: https://github.com/chkr1011/MQTTnet/issues
  54. Docs: https://github.com/chkr1011/MQTTnet/wiki/MQTTnetServer
  55. ");
  56. Console.BackgroundColor = ConsoleColor.White;
  57. Console.ForegroundColor = ConsoleColor.Red;
  58. Console.WriteLine(" ! THIS IS AN ALPHA VERSION! IT IS NOT RECOMMENDED TO USE IT FOR ANY DIFFERENT PURPOSE THAN TESTING OR EVALUATING!");
  59. Console.WriteLine();
  60. Console.ResetColor();
  61. }
  62. }
  63. }