You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB

  1. using Apewer;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Reflection;
  5. namespace Apewer.Run
  6. {
  7. class Program
  8. {
  9. public static string[] Arguments = null;
  10. static void Main(string[] args)
  11. {
  12. // Console.WriteLine(NetworkUtility.Resolve2("www.baidu.com"));
  13. // RunPublicClass(args);
  14. Console.WriteLine("ended");
  15. Console.ReadKey();
  16. }
  17. static void RunPublicClass(params string[] args)
  18. {
  19. Arguments = args;
  20. foreach (var type in ClassUtility.GetTypes(Assembly.GetExecutingAssembly()))
  21. {
  22. if (type.Equals(typeof(Program))) continue;
  23. if (!type.IsClass) continue;
  24. if (!type.IsPublic) continue;
  25. Console.Title = type.FullName;
  26. Console.WriteLine("New " + type.FullName);
  27. #if DEBUG
  28. Activator.CreateInstance(type);
  29. #else
  30. try
  31. {
  32. Activator.CreateInstance(type);
  33. }
  34. catch (Exception ex)
  35. {
  36. Console.WriteLine(ex.GetType().FullName);
  37. Console.WriteLine(ex.ToString());
  38. }
  39. #endif
  40. Console.WriteLine();
  41. }
  42. Console.WriteLine("end");
  43. Console.ReadKey();
  44. }
  45. }
  46. }