I am developing a folder lock application which also has functionality of recovery.I have implemented a openFileDialog which opens the file explorer and when any file is deleted by user will be saved to my custom directory. how can i implement the functionality of copying the file to my custom directory when user press delete button from keyboard or from context menu my openFileDialog code is given below
openFileDialog1.InitialDirectory = folderPath;
if (RESOURCE.Equals("Images"))
{
openFileDialog1.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|GIF Files (*.gif)|*.gif";
}
openFileDialog1.FilterIndex = 2;
openFileDialog1.RestoreDirectory = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
strfilename = openFileDialog1.InitialDirectory + openFileDialog1.FileName;
run();
}
catch (Exception ex)
{
MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
}
}