【发布时间】:2017-03-14 16:31:34
【问题描述】:
This is the error screenshot当我在 Vs2017 中编写 TcpClient-Server 程序时,出现以下问题。
Console.WriteLine("Waiting for a connection.....");
Socket s=myList.AcceptSocket();
Console.WriteLine("Connection accepted from " + s.RemoteEndPoint);`
它说 TcpListner 不包含一个不包含这样的方法。 请帮忙。完整代码见https://www.codeproject.com/Articles/1415/Introduction-to-TCP-client-server-in-C
感谢和问候, T.S.
【问题讨论】:
-
您是否错过了命名空间
using System.Net.Sockets;或using System.Net。我已经在 VS2015 上测试了代码。完全没有错误。请重新检查您的代码。 -
你还是报错?
-
嗨 active92,你能给我一个链接,因为我在 .net Core 上尝试这个可能不是运行它的 IDE。
-
@TonyStark 有链接吗?你是什么意思?我刚刚从您提供的链接中复制并粘贴了代码。
-
是的,错误仍然存在
标签: c# visual-studio tcpclient tcpserver