コード例 #1
0
ファイル: Program.cs プロジェクト: hhahh2011/CH.Gps
        static void OnStart(string[] args)
        {
            try
            {
                //初始化配置项字典
                ConfigHelper.Init(ConfigScope.GPSGatewayAlarmBusinessWS.ToString(), System.Configuration.ConfigurationSettings.AppSettings["CaseType"]);
                //string ip = "127.0.0.1"; // ConfigHelper.GetConfig("localip");
                //int port = int.Parse(ConfigHelper.GetConfig("localport"));

                server = new AlarmServer();
                server.Start();
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
コード例 #2
0
ファイル: Service1.cs プロジェクト: hhahh2011/CH.Gps
        protected override void OnStart(string[] args)
        {
            try
            {
                //初始化配置项字典
                ConfigHelper.Init(ConfigScope.GPSGatewayAlarmBusinessWS.ToString(), ConfigurationSettings.AppSettings["CaseType"]);
                //string ip = this.GetLocalIPAddress();   // ConfigHelper.GetConfig("localip");
                //int port = int.Parse(ConfigHelper.GetConfig("localport"));

                server = new AlarmServer();
                server.Start();
            }
            catch (Exception ex)
            {
                Logger.Fatal(ex, null);
            }
        }