Esempio n. 1
0
        static void Main(string[] args)
        {
            try
            {
                var backupSettings = new BackupSettings
                {
                    DbServerHostname = ConfigurationManager.AppSettings.Get("SQLServerHostname"),
                    LocalBackupPath = ConfigurationManager.AppSettings.Get("BackupPath"),
                    EncryptionKey = ConfigurationManager.AppSettings.Get("EncryptionKey"),
                    LocalBackupTempPath = ConfigurationManager.AppSettings.Get("BackupTempPath"),
                    DeleteOldBackups = Convert.ToBoolean(ConfigurationManager.AppSettings.Get("DeleteOldBackups")),
                    AddDateToArchive = Convert.ToBoolean(ConfigurationManager.AppSettings.Get("AddDateToArchive")),
                    FtpUrl = ConfigurationManager.AppSettings.Get("FtpUrl"),
                    FtpUsername = ConfigurationManager.AppSettings.Get("FtpUsername"),
                    FtpPassword = ConfigurationManager.AppSettings.Get("FtpPassword")
                };

                var backupService = new BackupService(backupSettings);

                backupService.DoBackup();
            }
            catch (Exception e)
            {

            }
        }