How about simply listing the files in the path using Directory.EnumerateFiles(String, String)
This way you can determine which filename is available before attempting to write the file.
How about simply listing the files in the path using Directory.EnumerateFiles(String, String)
This way you can determine which filename is available before attempting to write the file.