怪奇物语

怪奇物语

首页 新随笔 联系 管理
// 获取文件夹中后缀是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"));
posted on 2024-04-16 21:10  超级无敌美少男战士  阅读(142)  评论(0)    收藏  举报