private void MainFunc()
        {
            string     strPath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
            INIManager manager = new INIManager(strPath + @"\settings.ini");

            SQLConnect conn = new SQLConnect(manager.GetPrivateString("Oracle", "host"), manager.GetPrivateString("Oracle", "port"),
                                             manager.GetPrivateString("Oracle", "database"), manager.GetPrivateString("Oracle", "user"), manager.GetPrivateString("Oracle", "password"),
                                             manager.GetPrivateString("MySQL", "host"), manager.GetPrivateString("MySQL", "port"),
                                             manager.GetPrivateString("MySQL", "database"), manager.GetPrivateString("MySQL", "user"), manager.GetPrivateString("MySQL", "password"),
                                             manager.GetPrivateString("Request", "senderid"), manager.GetPrivateString("Request", "aggregator"));

            Mail mail = new Mail(manager.GetPrivateString("Email", "SMTPServer"), manager.GetPrivateString("Email", "from"),
                                 manager.GetPrivateString("Email", "to"), manager.GetPrivateString("Email", "port"), manager.GetPrivateString("Email", "login"),
                                 manager.GetPrivateString("Email", "password"));

            try
            {
                string[] fileNameArr = new string[2];
                fileNameArr[0] = GetRequestOracle(conn.oracleConnection, conn.senderId, strPath);
                fileNameArr[1] = GetRequestMySQL(conn.mysqlConnection, conn.aggregator, strPath);
                mail.SendMail(fileNameArr[0], fileNameArr[1], strPath);
            }
            catch (Exception ex)
            {
                Logger.Log.Error(ex.ToString());
            }
        }
        protected override void OnStart(string[] args)
        {
            Logger.InitLogger();
            Logger.Log.Info("Старт");

            string strPath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);

            try
            {
                INIManager manager = new INIManager(strPath + @"\settings.ini");
                timer = new TimerStruct(manager.GetPrivateString("Timer", "interval"), manager.GetPrivateString("Timer", "format"),
                                        manager.GetPrivateString("Timer", "condition"));

                /*// устанавливаем метод обратного вызова
                 * TimerCallback tm = new TimerCallback(CheckDate);
                 * // создаем таймер
                 * Logger.Log.Info(t.interval.ToString());
                 * Timer T2 = new Timer(tm, t, 0, t.interval);
                 */

                //MainFunc();

                Timer T2 = new Timer();
                T2.Interval  = timer.interval;
                T2.AutoReset = true;
                T2.Enabled   = true;
                T2.Start();
                T2.Elapsed += new ElapsedEventHandler(T2_Elapsed);
            }
            catch (Exception ex)
            {
                Logger.Log.Error(ex.ToString());
            }
        }