コード例 #1
0
        public FormParameters_FIleINI(string nameSetupFileINI) : base()
        {
            m_FileINI = new FileINI(nameSetupFileINI, false);
            //ProgramBase.s_iAppID = (int)ProgramBase.ID_APP.STATISTIC;
            //ProgramBase.s_iAppID = Int32.Parse(m_arParametrSetup[(int)PARAMETR_SETUP.ID_APP]);
            //ProgramBase.s_iAppID = Properties.s

            loadParam(true);
        }
コード例 #2
0
        public FormParametersTG_FileINI(string nameSetupFileINI)
        {
            m_FileINI = new FileINI(nameSetupFileINI, false);

            loadParam(true);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: dvgamerr/ConsoleApp
        static void Main(string[] args)
        {
            string  sConfigFile = null;
            FileINI cConfig     = null;

            try
            {
                for (var i = 0; i < args.Length; i++)
                {
                    switch (args[i])
                    {
                    case "--debug": IsDebug = true; break;

                    case "--config":
                        if (i + 1 > args.Length)
                        {
                            throw new Exception("configuration not found path.");
                        }
                        sConfigFile = args[i + 1].Replace("\"", "");
                        break;
                    }
                }
                if (!File.Exists(sConfigFile))
                {
                    throw new Exception("configuration not extsts path.");
                }

                cConfig = new FileINI(sConfigFile);

                Log("sConfig: {0}", sConfigFile);
                Log("IsDebug: {0}", IsDebug);

                ConsoleEventDelegate handler = new ConsoleEventDelegate(ConsoleCloseEventCallback);
                SetConsoleCtrlHandler(handler, true);

                Log("DNS Resolve...");
                var clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                clientSocket.Connect("10.0.80.59", 21);

                Log("Program Starting...");
                Program.onStart();
                do
                {
                    Program.onUpdate();
                    Thread.Sleep(Program.nIntervelTime);
                    if (!IsWaitCompleted)
                    {
                        continue;
                    }

                    Log("Program Stoping...");
                    Program.onStop();
                    if (IsWaitCompleted)
                    {
                        break;
                    }
                } while (true);
            }
            catch (Exception ex)
            {
                Error(ex);
            }
        }