Esempio n. 1
0
        /// <summary>
        /// //设置程序运行中产生的消息并计入日志
        /// </summary>
        /// <param name="msg">消息</param>
        protected void SetMSG(string msg)
        {
            ShowMSgDelegate showmsgDelegate = new ShowMSgDelegate(SetmsgDelegateTargetFun);

            if (txtBoxMSG.InvokeRequired)
            {
                txtBoxMSG.BeginInvoke(showmsgDelegate, msg);
            }
            else
            {
                if (txtBoxMSG.Text.Length > 1024 * 512)
                {
                    txtBoxMSG.Text = string.Empty;
                }
                txtBoxMSG.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + msg + "\r\n");
            }
            mu.WaitOne();
            //SiXi.Logs.Log.WriteDebugLog(msg);
            mu.ReleaseMutex();
        }
Esempio n. 2
0
 /// <summary>
 /// //设置程序运行中产生的消息并计入日志
 /// </summary>
 /// <param name="msg">消息</param>
 protected void SetMSG(string msg)
 {
     ShowMSgDelegate showmsgDelegate = new ShowMSgDelegate(SetmsgDelegateTargetFun);
     if (txtBoxMSG.InvokeRequired)
     {
         txtBoxMSG.BeginInvoke(showmsgDelegate, msg);
     }
     else
     {
         if (txtBoxMSG.Text.Length > 1024 * 512)
         {
             txtBoxMSG.Text = string.Empty;
         }
         txtBoxMSG.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + msg + "\r\n");
     }
     mu.WaitOne();
     SiXi.Logs.Log.WriteDebugLog(msg);
     mu.ReleaseMutex();
 }