Esempio n. 1
0
        public void SelectFile3(string theDirectory)
        {
            string           destinationFolder;
            OpenFileDialog   openFileDialog1 = new OpenFileDialog();
            DirectoryCreator dcr             = new DirectoryCreator();

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                var fileName = openFileDialog1.FileName;
                destinationFolder = AppDomain.CurrentDomain.BaseDirectory + @"Projet\" + RefProjet.ToString() + @"\PermisLotir\" + inputNumLotir.Text + @"\" + theDirectory + @"\" + System.IO.Path.GetFileName(openFileDialog1.FileName);
                dcr.CreateDirectoryPermisLotir(RefProjet.ToString(), inputNumLotir.Text + "/" + theDirectory);
                System.Windows.Forms.MessageBox.Show("operation réussi avec succès");
                if (File.Exists(destinationFolder))
                {
                    File.Delete(destinationFolder);
                }

                File.Copy(fileName, System.IO.Path.Combine(System.IO.Path.GetDirectoryName(fileName), destinationFolder));
            }
            else
            {
                System.Windows.MessageBox.Show("aucun fichier selectionné");
            }
        }