Пример #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="configFilePath">配置文件路径</param>
 public CSaveImage(string configFilePath)
 {
     imageFormat             = new ImageFormat(new Guid());
     _configFilePath         = configFilePath;
     myImageQueue            = new Queue <SaveImageStr>();
     saveImageTimer          = new System.Timers.Timer();
     saveImageTimer.Interval = 10;
     saveImageTimer.Elapsed += new System.Timers.ElapsedEventHandler(SaveImagePump);
     if (File.Exists(_configFilePath))
     {
         myINIObj = new CINIFile(_configFilePath);
     }
     else
     {
         try
         {
             File.Create(_configFilePath);
             myINIObj = new CINIFile(_configFilePath);
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
     InitPara();
     WritePara();
 }
Пример #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="savePath">保存图片的路径</param>
 public CSaveImage(string configFilepath, string savePath, bool isSave, string sectionName)
 {
     _configFilePath         = configFilepath;
     _path                   = savePath;
     _SectionName            = sectionName;
     _isSaveImage            = isSave;
     myImageQueue            = new Queue <SaveImageStr>();
     saveImageTimer          = new System.Timers.Timer();
     saveImageTimer.Interval = 10;
     saveImageTimer.Elapsed += new System.Timers.ElapsedEventHandler(SaveImagePump);
     if (File.Exists(_configFilePath))
     {
         myINIObj = new CINIFile(_configFilePath);
     }
     else
     {
         try
         {
             File.Create(_configFilePath);
             myINIObj = new CINIFile(_configFilePath);
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex.ToString());
             throw ex;
         }
     }
     InitPara();
     WritePara();
 }
Пример #3
0
        public CSafeSaveImage(ref CSaveImage _saveImage, string dbLinkStr) : base(_saveImage)
        {
            mySaveImage  = _saveImage;
            diskOperator = new COperaterDisk(mySaveImage.SaveImageRootDictroy);
            mySaveImage.RootDirectoryChangedEvent += new SaveImageRootDirectoryChangedEventHandle(diskOperator.ChangeRootDirectory);
            ini_Obj    = new CINIFile(mySaveImage.ConfigFilePath);
            dbOperator = new COperaterDB(dbLinkStr);
            //从本地INI文件中获取参数
            GetParaFromINIFile();

            mySaveImage.RootDirectoryChangedEvent += new SaveImageRootDirectoryChangedEventHandle(diskOperator.ChangeRootDirectory);
        }