I use this code to save an avi file. When I create a new file, it’s no problem.
But When I choose an existing file, It does not work and saveFileDialog still shows.
I have set saveDialog.OverwritePrompt and saveDialog.CheckFileExists is true, but it is not ok. If I set saveDialog.OverwritePrompt is false it runs, but it does show overwrite warning
How can I solve this?
SaveFileDialog saveDialog = new SaveFileDialog();
saveDialog.OverwritePrompt = true;
DialogResult dgResult = saveDialog.ShowDialog();
if (dgResult == DialogResult.OK)
{
exportAvi(saveDialog.FileName);
}
Your issue is in the exportAvi() function. You are not allowing for the file to be overwritten. I cannot see your exportAvi() function so I cannot tell you what is wrong exactly. If you post your exportAvi() function I can help you further.
Check your export function and make sure you are setting the overwrite parameter to True.