private void Log(string message) { if (prog.InvokeRequired) { prog.BeginInvoke((Action)(() => { prog.AppendLogLine(message); })); } else { prog.AppendLogLine(message); } }