void _service_OnMessage(object Sender, ImportExcelSVM.MessageEventArgs Args) { if (tbx_Message.Text.Length > 30000) tbx_Message.Text = ""; tbx_Message.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); if (Args.Task != "") tbx_Message.AppendText(" 当前操作:" + Args.Task.ToString()); tbx_Message.AppendText("\r\n"); tbx_Message.AppendText("消息内容:" + Args.Message + "\r\n"); tbx_Message.AppendText("\r\n"); }
public Form1() { InitializeComponent(); CheckForIllegalCrossThreadCalls = false; this.Text += " Version:" + Application.ProductVersion; string title = MCSFramework.Common.ConfigHelper.GetConfigString("PageTitle"); if (title != null) { this.Text += " " + title; } _importsevice = new ImportExcelSVM(); _importsevice.OnMessage += new ImportExcelSVM.MessageHandel(_service_OnMessage); bt_Begin_Click(null, null); }