ServiceMBIClientHandler.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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.ReadKey();
  31. }
  32. public static void Stop()
  33. {
  34. m_Client?.Close();
  35. }
  36. }
  37. }