Exemple #1
0
        private void LogInformation(string content, int dir = AToolConstants.LOG_NONE)
        {
            StringBuilder outputSb = new StringBuilder();

            if (configInfo.RecvShowTime)
            {
                string dateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
                outputSb.Append("[");
                outputSb.Append(dateTime);
                outputSb.Append("]");
                if (dir == AToolConstants.LOG_RECV)
                {
                    outputSb.Append("收<-");
                }
                else if (dir == AToolConstants.LOG_SEND)
                {
                    outputSb.Append("发<-");
                }
                else if (dir == AToolConstants.LOG_NONE)
                {
                }
            }

            outputSb.Append(content);

            DelegateControls.SetRichText(this, this.richTextBox1, Color.Black, outputSb.ToString(), true, false);

            if (dir != AToolConstants.LOG_NONE)
            {
                outputSb.Remove(0, 25);
            }

            LogHelper.Info(outputSb.ToString());
        }
Exemple #2
0
 private void LogRecv(string content)
 {
     DelegateControls.SetRichText(this, this.richTextBox1, Color.Black, content, true, false);
 }
Exemple #3
0
 private void LogWarning(string content)
 {
     DelegateControls.SetRichText(this, this.richTextBox1, Color.Yellow, content, true, false);
 }