c#:文件夹下批量修改后缀

2023-08-24 15:02:49 浏览数 (2)

代码语言:javascript复制
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mp41
{
    class Program
    {
        static void Main(string[] args)
        {
            var dir = Directory.GetCurrentDirectory();
            foreach (var f in new DirectoryInfo(dir).GetFiles("*.mp41", SearchOption.TopDirectoryOnly))
            {
                f.MoveTo(Path.ChangeExtension(f.FullName, "mp4"));
            }
        }
    }
}

0 人点赞