public void AddLog(string text) //添加日志 { if (this.listBox1.InvokeRequired) { SetTextCallback d = new SetTextCallback(AddLog); try //添加异常处理,当有连接窗口关闭时会出现一异常 { this.Invoke(d, new object[] { text }); } catch { return;//出现异常则直接返回 } } else { this.listBox1.Items.Add(text); } } public class ThreadServer { public TcpListener Svr; public List<TrSok> mls = new List<TrSok>(); Form1 t; public ThreadServer(Form1 l) { Svr = new TcpListener(IPAddress.Any, 6060); t = l; Svr.Start(); } public vo