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)); }
/// <summary> /// 清除所有输出内容 /// </summary> public void ClearOutputText() { if (output == null) { return; } output.ClearText(); }