/// <summary> /// 向输出窗体追加一行文本 /// </summary> /// <param name="s"></param> public void AppendOutputLine(string text, bool newLine = true) { if (newLine) { output.AppendLine(text); } else { output.AppendText(text); } }
void Log(Exception ex) { if (output == null) { output = new Output(); } output.ClearText(); output.AppendText(ex.ToString()); output.DockState = DockState.DockBottom; output.Activate(); string logFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log.txt"); File.AppendAllText(logFile, string.Format("{0}\r\n{1}\r\n", ex.Message, ex.StackTrace)); }