using System;
using System.IO;
public class Test
{
public static void Main()
{
string path = @"photo\myFolder\image.jpg";
string file = Path.GetFileNameWithoutExtension(path);
string NewPath = path.Replace(file, file + "-resize");
Console.WriteLine(NewPath); //photo\myFolder\image-resize.jpg
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uSU87CgpwdWJsaWMgY2xhc3MgVGVzdAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CgkJc3RyaW5nIHBhdGggPSBAInBob3RvXG15Rm9sZGVyXGltYWdlLmpwZyI7CiAgICAgICAgICAgICAgICBzdHJpbmcgZmlsZSA9IFBhdGguR2V0RmlsZU5hbWVXaXRob3V0RXh0ZW5zaW9uKHBhdGgpOwogICAgICAgICAgICAgICAgc3RyaW5nIE5ld1BhdGggPSBwYXRoLlJlcGxhY2UoZmlsZSwgZmlsZSArICItcmVzaXplIik7CiAgICAgICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZShOZXdQYXRoKTsgLy9waG90b1xteUZvbGRlclxpbWFnZS1yZXNpemUuanBnCgl9Cn0=