zhao
2021-07-19 8347f2fbddbd25369359dcb2da1233ac48a19fdc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using HH.WMS.BLL;
using HH.WMS.Common;
using HH.WMS.Entitys;
using HH.WMS.Entitys.Sys;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.ServiceProcess;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace HH.WMS.CoreServer
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
 
            #region 初始化加载系统配置
            try
            {
                string wms_ipAddress = ConfigurationManager.AppSettings["wms_ipAddress"].ToString();
                if (wms_ipAddress != "")
                {
                    //获取服务端配置的Config
                    Constants.SysConfig.WMS_API= wms_ipAddress;
                    string strResult = WebApiManager.HttpWMS_Get("api/Login/InitConfig");
                    OperateResult or = JsonConvert.DeserializeObject<OperateResult>(strResult);
                    if (or.Status == ResultStatus.Success)
                    {
                        Constants.SysConfig = JsonConvert.DeserializeObject<SysConfigParamEntity>(or.Data.ToString());
                        Constants.SysConfig.WMS_API=wms_ipAddress;
                    }
                }
            }
            catch (Exception ex)
            {
            }
            #endregion
 
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
 
            Application.Run(CoreMain.GetInstance());
            //Application.Run(new HH.WMS.CoreServer.Service.Wave());
 
            //ServiceBase[] ServicesToRun;
            //ServicesToRun = new ServiceBase[]
            //{
            //    new U8DataAynchronizationService()
            //};
            //ServiceBase.Run(ServicesToRun);
        }
    }
}