线程间操作无效: 从不是创建控件“label4”的线程访问它。
//主线程 public delegate void UpdateMessage(string mes); public void UpdatePortMessage(string mes) { this.txtMessage.AppendText(string.Format("Connected {0}. succeed", mes) + "\r\n"); this.txtClientIP.Text = mes; } // 线程1 UpdateMessage upPort = new UpdateMessage(UpdatePortMessage); this.BeginInvoke(upPort, point);