Program.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.IO;
  5. using System.Windows.Forms;
  6. namespace MAutoUpdate.Test
  7. {
  8. static class Program
  9. {
  10. /// <summary>
  11. /// 应用程序的主入口点。
  12. /// </summary>
  13. [STAThread]
  14. static void Main()
  15. {
  16. //启动clickonce
  17. //Process.Start("iexplore.exe", "http://192.168.0.45:9923/EapForIdle.application");
  18. Process.Start("rundll32.exe", "dfshim.dll,ShOpenVerbApplication " + "http://192.168.0.45:9923/EapForIdle.application");
  19. string path = AppDomain.CurrentDomain.BaseDirectory + "MAutoUpdate.exe";
  20. //同时启动自动更新程序
  21. if (File.Exists(path))
  22. {
  23. ProcessStartInfo processStartInfo = new ProcessStartInfo()
  24. {
  25. FileName = "MAutoUpdate.exe",
  26. Arguments = " MAutoUpdate.Test 1"
  27. };
  28. Process proc = Process.Start(processStartInfo);
  29. if (proc != null)
  30. {
  31. proc.WaitForExit();
  32. }
  33. }
  34. Application.EnableVisualStyles();
  35. Application.SetCompatibleTextRenderingDefault(false);
  36. Application.Run(new Form1());
  37. }
  38. }
  39. }