标签:key 文件名 获取文件 txt pac var arp csharp xxx
String path =
@"X:\xxx\xxx"
;
//第一种方法
var
files = Directory.GetFiles(path,
"*.txt"
);
foreach
(
var
file
in
files)
Console.WriteLine(file);
//第二种方法
DirectoryInfo folder =
new
DirectoryInfo(path);
foreach
(FileInfo file
in
folder.GetFiles(
"*.txt"
))
{
Console.WriteLine(file.FullName);
}
标签:key 文件名 获取文件 txt pac var arp csharp xxx
原文地址:https://www.cnblogs.com/aliHong/p/8847619.html