public static void Main()
Console.WriteLine(MorphPath(@"C:\test\perf.log", 1));
Console.WriteLine(MorphPath(@"C:\test\perf.log", 2));
Console.WriteLine(MorphPath(@"C:\test\perf.log", 3));
Console.WriteLine(MorphPath(@"C:\test\perf.log", 4));
private static string MorphPath(string path, int retry)
string dir = Path.GetDirectoryName(path);
string fileName = Path.GetFileNameWithoutExtension(path);
string ext = Path.GetExtension(path);
return Path.Combine(dir, string.Format("{0}-{1}{2}", fileName, retry, ext));