TCP中首先要在服务端开启监听,这样才可以从客户端链接 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net.Sockets; using System.Collections; using System.Net; namespace Server { class Program { static UdpClient server; static…
服务端代码如下: using System;using System.Net;using System.Net.Sockets;using System.Text;using System.Threading;using System.Windows.Forms; namespace Client{ public partial class Form1 : Form { public Form1() { InitializeComponent(); //对 Windows 窗体控件进行线程安全调…