DirectoryInfo TheFolder = new DirectoryInfo(path); if (!TheFolder.Exists) return; //遍历文件 foreach (FileInfo NextFile in TheFolder.GetFiles()) { if (NextFile.Name == "0-0-11.grid") continue; // 获取文件完整路径 string heatmappath = NextFile.FullName; }