/// <summary> /// 像下载日志中添加记录 /// </summary> /// <param name="msg"></param> private void AppendLog(string msg) { txtLog.BeginInvoke(new Action(() => { //txtLog.Properties..AppendText(msg + Environment.NewLine); AppendTextToMemoEdit(txtLog, msg); })); } /// <summary> /// 追加文本到MemoEdit中 /// </summary> /// <param name="memoEdit"></param> /// <param name="strText"></param> public static void AppendTextToMemoEdit(MemoEdit memoEdit, string strText) { try { memoEdit.Text = memoEdit.Text + "\r\n" + strText; memoEdit.SelectionStart = memoEdit.Text.Length; memoEdit.ScrollToCaret(); Application.DoEvents(); } catch { return; } }