ServiceMBIClientHandler.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* ==============================================================================
  2. * 功能描述:ServiceMBIClientHandler
  3. * 创 建 者:Garrett
  4. * 创建日期:2019/4/12 15:08:46
  5. * ==============================================================================*/
  6. using System;
  7. using System.Windows.Forms;
  8. using TaskDatabase;
  9. using TaskDatabase.Model;
  10. using System.Configuration;
  11. namespace Client.Start
  12. {
  13. /// <summary>
  14. /// ServiceMBIClientHandler
  15. /// </summary>
  16. public class ServiceMBIClientHandler
  17. {
  18. private static ClientApp m_Client;
  19. public static void Start()
  20. {
  21. string ip = ConfigurationManager.AppSettings["IP"];
  22. Console.WriteLine(ip);
  23. int port = Convert.ToInt32(ConfigurationManager.AppSettings["Port"]);
  24. string dir = ConfigurationManager.AppSettings["DownloadFileDir"];
  25. int maxtask = Convert.ToInt32(ConfigurationManager.AppSettings["MaxTaskCount"]);
  26. int maxDownloadTask = Convert.ToInt32(ConfigurationManager.AppSettings["MaxDownloadTaskCount"]);
  27. //192.168.20.225
  28. m_Client = new ClientApp(ip, port, dir, maxtask, new RevitCmdExecutor(), maxDownloadTask);
  29. m_Client.Start();
  30. //Console.WriteLine("begin");
  31. //Console.ReadKey();
  32. }
  33. public static void Stop()
  34. {
  35. m_Client?.Close();
  36. }
  37. }
  38. }