Ejemplo n.º 1
0
        private void Process()
        {
            try
            {
                //You don't start process, here
                //Read next run date and time from local DB and set timer elapse time

                //check next download date for Data & Image from config and run download
                clsLog.LogInfo("Reading next run date and time ...");
                if (GetNextRun("PROCESS NAME") < System.DateTime.Now)
                {
                    clsLog.LogInfo("Process starting");

                    var drive = new GetDriveData.GetData()
                    {
                        DownloadLocation = ConfigurationManager.AppSettings["Download_Folder"]
                    };
                    drive.ReadDriveFolderForFiles();

                    //UpdateRowSource status for next run
                }
            }
            catch (Exception ex)
            {
                clsLog.LogError(ex.ToString());
            }
        }
Ejemplo n.º 2
0
        public void ReadVINFromDrive()
        {
            var google_ClientId = ConfigurationManager.AppSettings["Google_ClientId"];
            var google_Secret   = ConfigurationManager.AppSettings["Google_Secret"];
            var google_UserName = ConfigurationManager.AppSettings["Google_UserName"];

            var downloadFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings["Download_Drive_Folder"]);

            if (!Directory.Exists(downloadFolder))
            {
                Directory.CreateDirectory(downloadFolder);
            }

            var res = new GetDriveData.GetData()
            {
                DownloadLocation = downloadFolder, GoogleClientId = google_ClientId, GoogleClientSecret = google_Secret, GoogleUserName = google_UserName
            }.ReadDriveFolderForFiles();
        }