Program.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. namespace OTSPartA_STDEditor
  8. {
  9. static class Program
  10. {
  11. static Program()
  12. {
  13. string privatepath = "System;Common;SQLiteDll;OxfordExtender;OTSCPPDll;OpenCvSharp;CefSharp";
  14. AppDomain.CurrentDomain.SetData("PRIVATE_BINPATH", privatepath);
  15. AppDomain.CurrentDomain.SetData("BINPATH_PROBE_ONLY", privatepath);
  16. var m = typeof(AppDomainSetup).GetMethod("UpdateContextProperty", BindingFlags.NonPublic | BindingFlags.Static);
  17. var funsion = typeof(AppDomain).GetMethod("GetFusionContext", BindingFlags.NonPublic | BindingFlags.Instance);
  18. m.Invoke(null, new object[] { funsion.Invoke(AppDomain.CurrentDomain, null), "PRIVATE_BINPATH", privatepath
  19. });
  20. }
  21. /// <summary>
  22. /// 应用程序的主入口点。
  23. /// </summary>
  24. [STAThread]
  25. static void Main(string[] args)
  26. {
  27. Application.EnableVisualStyles();
  28. Application.SetCompatibleTextRenderingDefault(false);
  29. //Application.Run(new Form_ConstantsEditor2());
  30. Form_Main form_ConstantsEditor2;
  31. if (args.Length > 1)
  32. {
  33. form_ConstantsEditor2 = new Form_Main(args);
  34. }
  35. else
  36. {
  37. form_ConstantsEditor2 = new Form_Main();
  38. }
  39. if (args.Length > 0)
  40. {
  41. form_ConstantsEditor2.STDDBAddress = args[0];
  42. }
  43. Application.Run(form_ConstantsEditor2);
  44. }
  45. }
  46. }