需要定义 Socket socketSend; Socket socket; Dictionary<string, Socket> dictionary = new Dictionary<string, Socket>(); 监听IP、端口 Control.CheckForIllegalCrossThreadCalls = false; this.WindowState = FormWindowState.Maximized; socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPAddress ip = IPAddress.Parse("192.166.2.48"); int port = Convert.ToInt32(5555); IPEndPoint iPEndPoint = new IPEndPoint(ip, port); socket.Bind(iPEndPoint); using (StreamWriter sw = new...