public IActionResult BackUpToJson()
        {
            string fileName = "D:\\data\\бэкап\\бэкап";

            if (Directory.Exists(fileName))
            {
                _backUp.CreateArchive(fileName);
                return(RedirectToAction("BackUp"));
            }
            else
            {
                DirectoryInfo di = Directory.CreateDirectory(fileName);
                _backUp.CreateArchive(fileName);
                return(RedirectToAction("BackUp"));
            }
        }
Exemple #2
0
        public IActionResult BackUpToJson()
        {
            string fileName = "C:\\Users\\Михан\\Desktop\\backUp\\backUp";

            if (Directory.Exists(fileName))
            {
                _backUp.CreateArchive(fileName);
                return(RedirectToAction("BackUp"));
            }
            else
            {
                DirectoryInfo di = Directory.CreateDirectory(fileName);
                _backUp.CreateArchive(fileName);
                return(RedirectToAction("BackUp"));
            }
        }
Exemple #3
0
 private void сохранитьФайлToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (backUpAbstractLogic != null)
         {
             var fbd = new FolderBrowserDialog();
             if (fbd.ShowDialog() == DialogResult.OK)
             {
                 backUpAbstractLogic.CreateArchive(fbd.SelectedPath);
                 MessageBox.Show("Файл сохранен", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 public IActionResult Backup()
 {
     _logic.CreateArchive();
     return(RedirectToAction("Index", "Product"));
 }