public void Close()
{
if (histfile == null)
return;
try
{
using (StreamWriter sw = File.CreateText(histfile))
{
int start = (count == history.Length) ? head : tail;
for (int i = start; i < start + count; i++)
{
int p = i % history.Length;
sw.WriteLine(history[p]);
}
}
}
catch
{
// ignore
}
}