public static void RenameRomPictures(Rom rom, string newFileName) { var newname = RomFunctions.GetFileNameNoExtension(newFileName); if (newname != rom.FileNameNoExt) { string boxpic = RomFunctions.GetRomPicture(rom, Values.BoxartFolder); string titlepic = RomFunctions.GetRomPicture(rom, Values.TitleFolder); string gameplaypic = RomFunctions.GetRomPicture(rom, Values.GameplayFolder); if (!string.IsNullOrEmpty(boxpic)) { File.Move(boxpic, boxpic.Substring(0, boxpic.LastIndexOf("\\")) + "\\" + newname + boxpic.Substring(boxpic.LastIndexOf("."))); } if (!string.IsNullOrEmpty(titlepic)) { File.Move(titlepic, titlepic.Substring(0, titlepic.LastIndexOf("\\")) + "\\" + newname + titlepic.Substring(titlepic.LastIndexOf("."))); } if (!string.IsNullOrEmpty(gameplaypic)) { File.Move(gameplaypic, gameplaypic.Substring(0, gameplaypic.LastIndexOf("\\")) + "\\" + newname + gameplaypic.Substring(gameplaypic.LastIndexOf("."))); } } }