Пример #1
0
        /// <summary>
        /// 添加状态信息
        /// </summary>
        /// <param name="str"></param>
        private void AddContent(string str)
        {
            if (TextMain.InvokeRequired)
            {
                AddContentDelegate d = new AddContentDelegate(AddContent);
                TextMain.Invoke(d, new object[] { str });
            }
            else
            {
                string Update_Date = DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day;
                string Update_Time = string.Format("{0:00}:{1:00}:{2:00}.{3:0000}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond);

                TextMain.AppendText("【" + Update_Date + " " + Update_Time + "】    " + str + Environment.NewLine);
                TextMain.ScrollToCaret();
            }
        }
Пример #2
0
 public Form1()
 {
     InitializeComponent();
     AddContent = new AddContentDelegate(AddContentFunction);
 }