获取指定文件夹下所有文件 C# 方法一: String filePath = @"D:\csdn_wuwt"; var files = Directory.GetFiles(filePath, "*.xml"); foreach (var file in files) Console