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.

63 lines
1.5 KiB

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