Esempio n. 1
0
 /**
  * 执行定时任务
  * */
 private void startTimeJob(Timer timer)
 {
     //执行时间间隔
     timer.Interval = GlobleParams.getFrequency() * 1000;
     timer.Elapsed += new ElapsedEventHandler(Worker.work);
     timer.Start();
 }
        /**
         * 写日志
         */
        private static void writeLog(StringBuilder sb)
        {
            FileStream   fs = new FileStream(GlobleParams.setLogFilePath(), FileMode.Create, FileAccess.Write);
            StreamWriter sw = new StreamWriter(fs, Encoding.GetEncoding("gb2312"));

            sw.WriteLine(sb.ToString());
            sw.Close();
            sw.Dispose();
            fs.Close();
            fs.Dispose();
        }
 public static string getConnectionString()
 {
     return("server=" + GlobleParams.getDatabaseIP() + ";port=3306;userid=" + GlobleParams.getDatabaseUser() +
            ";password="******";database=" + ";charset=utf8;");    //数据库表来自程序的配置文件
 }