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.

62 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 FileRenamer();
  16. // new HashComputer();
  17. Console.WriteLine("ended");
  18. Console.ReadKey();
  19. }
  20. static void RunPublicClass(params string[] args)
  21. {
  22. Arguments = args;
  23. foreach (var type in ClassUtility.GetTypes(Assembly.GetExecutingAssembly()))
  24. {
  25. if (type.Equals(typeof(Program))) continue;
  26. if (!type.IsClass) continue;
  27. if (!type.IsPublic) continue;
  28. Console.Title = type.FullName;
  29. Console.WriteLine("New " + type.FullName);
  30. #if DEBUG
  31. Activator.CreateInstance(type);
  32. #else
  33. try
  34. {
  35. Activator.CreateInstance(type);
  36. }
  37. catch (Exception ex)
  38. {
  39. Console.WriteLine(ex.GetType().FullName);
  40. Console.WriteLine(ex.ToString());
  41. }
  42. #endif
  43. Console.WriteLine();
  44. }
  45. Console.WriteLine("end");
  46. Console.ReadKey();
  47. }
  48. }
  49. }