You looks like you could use a
do...while
loop to go through successive files, right now it looks like you try only the "raw" filename and change to raw1 if the original exists.
You could incorporate this into your code to get the last numbered version of the file. The syntax may not be 100% as I am limited to notepad at the moment
private int GetLastFileNumber(string FileFolder, string Filename, string FileExtension) {
int FileCount = 0;
string FileCheck;
string FileExists = True;
do {
if (FileCount == 0) { FileCheck = Filename + "." + FileExtension; }
else { FileCheck = string.Format("{0}{1}.{2}", FileName, FileCount, FileExtension);
FileExists = File.Exists(FileFolder+FileCheck)
FileCount++
} while(FileExists);
return FileCount;
}