workaround for the missing 'OverwritePrompt' in SaveFileDialog?

  • Thread starter Thread starter ORC
  • Start date Start date
O

ORC

Does anyone know how to make a workaround for the missing 'OverwritePrompt'
in SaveFileDialog? I have an application where the user aren't allow to
overwrite existing files but only to append to then.

Thanks,
Ole
 
What you can do is use File.Exists() with the filename returned from the
savefiledialog. If it exists you can either display a warning and show the
savefiledialog again for the user to specify a different name, or append
something to the filename (MyFile 1.txt), and check again with File.Exists()
until you have a unique filename.

Peter
 
OK - that's what I have done, so I'll keep that solution - I hoped that
there was a better one.
Thank you for your reply!

Ole
 
Back
Top