Is there a built in .NET function to get a unique filename if a filename already exists? So if I try and save MyDoc.doc and it already exists, the file will save with name MyDoc(1).doc, the same way a browser download works for example.
If not, what is the most efficient way to achieve this result?
I am using the File.Move function at the moment btw.
check the name against Regex
*.\(\d+\), if it doesn’t match, add (1), if it matches increment the number in brackets.