private string parseLogTail(string file)
{
string[] lines;
using (var fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var sr = new StreamReader(fs)) {
string wholeLog = sr.ReadToEnd();
char[] split = new char[2];
split[0] = '\r';
split[1] = '\n';
lines = wholeLog.Split(split);
}
string hashrate = "";
for (int i = lines.Length - 1; i > 0; i--) {
if (lines[i].Contains("Speed: ")) {
string[] line = lines[i].Split('\t');
hashrate = line[2].Substring(7, line[2].IndexOf(',') - 7);
break;
}
}
return hashrate;
}