NuGet包管理器搜索安装NDbfReader
NDbfReader包项目url:GitHub - eXavera/NDbfReader: A fully managed reader of DBF files. Fast and lightweight with async support.
using NDbfReader;
string filterPath = @"F:\桌面\筛选过滤";
foreach (var item in Directory.GetFiles(filterPath))
{
if (item.EndsWith(".dbf"))
{
using (Table table = Table.Open(item))
{
var reader = table.OpenReader(Encoding.UTF8);
while (reader.Read())
{
label1.Text = reader.GetDecimal("area").ToString();
}
}
}
}
通过reader可以很容易的读取到.dbf文件内容