1.服务器端
代码如下 | 复制代码 |
using System; using System.Net; using System.Net.Sockets; using System.Text; namespace ConsoleApplication1 /// <summary> Console.WriteLine("{0:HH:mm:ss}从{1}发来数据:{2}", DateTime.Now, ipendpoint.Address, data); |
2.客户端
代码如下 | 复制代码 |
using System; using System.Net; using System.Net.Sockets; using System.Text; namespace ConsoleApplication1 /// <summary> |