// 获取文件夹中后缀是txt的文件
string directoryPath = @"/Users/Code/Wechat.Crawler/Links";
string[] filePaths = Directory.GetFiles(directoryPath, "*.txt");
// 获取文件夹中后缀是txt和html的文件
string directoryPath = @"/Users/Code/Wechat.Crawler/Links";
var filePaths = Directory.EnumerateFiles(directoryPath, "*.*", SearchOption.AllDirectories)
.Where(s => s.EndsWith(".html") || s.EndsWith(".txt"));
浙公网安备 33010602011771号