时间:2021-11-25 11:33:32 | 栏目:.NET代码 | 点击:次
代码分2块,server端:
private static void ProcessTcpClient(object state)
{
TcpClient client=state as TcpClient;
if(client==null)
Console.WriteLine("client is null");
NetworkStream ns=client.GetStream();
StreamWriter sw = new StreamWriter(ns);
sw.WriteLine("Welcome.");
sw.Flush();
sw.Close();
client.Close();
}
client端: