public static void BackupSettings()
        {
            string dirbackup = Path.Combine(Engine.DocsAppFolder, "Archive");

            if (Engine.ConfigUploaders.FTPAccountList2.Count > 0)
            {
                string fpftp = Path.Combine(dirbackup, string.Format("{0}-{1}-ftp-accounts.{2}", Application.ProductName, DateTime.Now.ToString("yyyyMM"), Engine.EXT_FTP_ACCOUNTS));
                if (!File.Exists(fpftp))
                {
                    FTPAccountManager fam = new FTPAccountManager(Engine.ConfigUploaders.FTPAccountList2);
                    fam.Save(fpftp);
                }
            }

            string fpWorkflowConfig = Path.Combine(dirbackup, string.Format("{0}-{1}-{2}", Application.ProductName, DateTime.Now.ToString("yyyyMM"), Engine.WorkflowConfigFileName));
            if (!File.Exists(fpWorkflowConfig))
            {
                Engine.ConfigWorkflow.Write(fpWorkflowConfig);
            }

            string fpoutputsconfig = Path.Combine(dirbackup, string.Format("{0}-{1}-{2}", Application.ProductName, DateTime.Now.ToString("yyyyMM"), Engine.UploadersConfigFileName));
            if (!File.Exists(fpoutputsconfig))
            {
                Engine.ConfigUploaders.Save(fpoutputsconfig);
            }

            if (Engine.ConfigUI != null)
            {
                string fp = Path.Combine(dirbackup, string.Format("{0}-{1}-Settings.xml", Application.ProductName, DateTime.Now.ToString("yyyyMM")));
                if (!File.Exists(fp))
                {
                    Engine.ConfigUI.Write(fp);
                }
            }
        }
Esempio n. 2
0
        private void FTPAccountsImport()
        {
            OpenFileDialog dlg = new OpenFileDialog {
                Filter = "FTP Accounts(*.zfa)|*.zfa"
            };

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                FTPAccountManager fam = FTPAccountManager.Read(dlg.FileName);
                FTPSetup(fam.FTPAccounts);
            }
        }
Esempio n. 3
0
 private void FTPAccountsExport()
 {
     if (Config.FTPAccountList2 != null)
     {
         SaveFileDialog dlg = new SaveFileDialog
         {
             FileName = string.Format("{0}-{1}-accounts", Application.ProductName, DateTime.Now.ToString("yyyyMMdd")),
             Filter   = "FTP Accounts(*.zfa)|*.zfa"
         };
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             FTPAccountManager fam = new FTPAccountManager(Config.FTPAccountList2);
             fam.Save(dlg.FileName);
         }
     }
 }
 private void FTPAccountsExport()
 {
     if (Config.FTPAccountList != null)
     {
         SaveFileDialog dlg = new SaveFileDialog
         {
             FileName = string.Format("{0}-{1}-accounts", Application.ProductName, DateTime.Now.ToString("yyyyMMdd")),
             Filter = "FTP Accounts(*.json)|*.json"
         };
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             FTPAccountManager fam = new FTPAccountManager(Config.FTPAccountList);
             fam.Save(dlg.FileName);
         }
     }
 }
 public static void BackupFTPSettings()
 {
     if (Adapter.CheckFTPAccounts())
     {
         string fp = Path.Combine(Engine.SettingsDir, string.Format("{0}-{1}-accounts.{2}", Application.ProductName, DateTime.Now.ToString("yyyyMM"), Engine.EXT_FTP_ACCOUNTS));
         if (!File.Exists(fp))
         {
             FTPAccountManager fam = new FTPAccountManager(Engine.conf.FTPAccountList);
             fam.Save(fp);
         }
     }
 }