String path = @"X:\xxx\xxx";
//第一种方法
string[] files = Directory.GetFiles(path, "*.txt");
foreach (string file in files)
{
Console.WriteLine(file);
}
//第二种方法
DirectoryInfo folder = new DirectoryInfo(path);
foreach (FileInfo file in folder.GetFiles("*.txt"))
{
Console.WriteLine(file.FullName);
}
亲爱的:被墙域名跳转TG:@qianhenetwork QQ:851617266,可否收藏+评论+分享呢?
文章评论 本文章有个评论