private void AsyncTcpServer1_ReceiveData(object sender, TcpServerReceiveDatadEventArgs e) { Trace.WriteLine($"{e.Socket.RemoteEndPoint.ToString()}:收到{ Encoding.ASCII.GetString(e.Data)}"); }
private void ReceiveData(object sender, TcpServerReceiveDatadEventArgs e) { Invoke(new Action(() => { ReceivetextBox.Text = ReceivetextBox.Text + $"{ e.Socket.RemoteEndPoint.ToString() + "->收到:" + Encoding.ASCII.GetString(e.Data)}\r\n"; })); }