C#- using System;
- using System.IO;
-
- class Program
- {
- static void Main()
- {
- string WorkPath = @"D:\GIN\c#\test";
- string terget = "image.png";
- string temp;
- foreach (var n in Directory.GetFiles(WorkPath, "100*.png", SearchOption.AllDirectories))
- {
- temp = Path.Combine(Path.GetDirectoryName(n), terget);
- Console.WriteLine("正在重命名 {0}", n);
- File.Move(n, temp);
- }
- }
- }
复制代码
|