public static void FileExtensionRenameDemo() { Console.WriteLine("Enter the fully qualified path to the file: "); string filePath = Console.ReadLine(); Console.WriteLine("Enter the new file entension (without the \".\"): "); string newExtension = Console.ReadLine(); Console.Write("Delete old file afterwards? (y/n): "); bool deleteOld = Console.ReadLine().ToLower() == "y" ? true : false; FileManip.FileExtensionRename(filePath, newExtension, deleteOld); }
public static void RecursiveExtensionRenameDemo() { Console.WriteLine("Enter the path to the base directory to begin renaming: "); string filePath = Console.ReadLine(); Console.WriteLine("Enter the current file entension (without the \".\"): "); string currentExtension = Console.ReadLine(); Console.WriteLine("Enter the new file entension (without the \".\"): "); string newExtension = Console.ReadLine(); Console.Write("Delete old file afterwards? (y/n): "); bool deleteOld = Console.ReadLine().ToLower() == "y" ? true : false; FileManip.RecursiveExtensionRename(filePath, currentExtension, newExtension, deleteOld); }