- 11
- 0
- 约9.26万字
- 约 98页
- 2016-12-29 发布于重庆
- 举报
C#Socket网络编程大全
1.简单服务器端/*using System.Data;using System.Net.Sockets;using System.Net;using System.Threading;private static int port = %%2;private static Thread thThreadRead;private static TcpListener TcpListen;private static bool bListener = true;private static Socket stRead;*/private static void Listen(){ try { TcpListen = new TcpListener(port); TcpListen.Start(); stRead = TcpListen.AcceptSocket(); EndPoint tempRemoteEP = stRead.RemoteEndPoint; IPEndPoint tempRemoteIP = (IPEndPoint)tempRemoteEP; IPHostEntry host = Dns.GetHostByAddress(tempRemoteIP.Address); str
原创力文档

文档评论(0)