This code will rename all the files names :
static private void RenameFiles()
{
images = Directory.GetFiles(sf, "*.gif");
foreach (string name in images)
{
Console.WriteLine("Working on current file: " + name);
//string newName = name.Replace("radar_temp_directory", String.Empty);
//string newName = Path.Combine(Path.GetFullPath(name),Path.GetFileName(name).Replace("radar_temp_directory", String.Empty));
string newName = Path.Combine(Path.GetDirectoryName(name), Path.GetFileName(name).Replace("radar_temp_directory", String.Empty));
File.Move(name, newName);
}
}
But now i want to make another method that will change each file extention from Gif to gif. Or if it will be "gIf" so all the extentions of the files will be .gIf But now i want to change it to gif. So for example if i have a file radar000005.Gif it will be radar000005.gif