using System;
using System.IO;
public class ExtractorDBF
{
public static void Main()
{
FileStream fileDBF = File.OpenRead("example.dat");
byte[] data = new byte[32];
int amountRead = fileDBF.Read(data, 0, 32);
if (amountRead != 32)
{
Console.WriteLine("Error!!!");
}
else
{
size = data[8] + data[9] * 256;
int numberFields = size / 32 - 1;
for (int i = 0; i < numberFields; i++)
{
amountRead = fileDBF.Read(data, 0, 32);
string nameField = "";
for (int j = 0; j < 11; j++)
{
nameField += Convert.ToChar(data[j]);
}
Console.WriteLine("Name: {0}", nameField);
}
fileDBF.Close();
}
}
}