Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# System.Net.Sockets命名空间中缺少TCPListener_C#_.net 3.5 - Fatal编程技术网

C# System.Net.Sockets命名空间中缺少TCPListener

C# System.Net.Sockets命名空间中缺少TCPListener,c#,.net-3.5,C#,.net 3.5,我正在使用TCPListener,根据页面,它应该在System.Net.Sockets中,我有 using System.Net; using System.Net.Sockets; ... TCPListener tcpListener = new TCPListener(10); Visual Studio正在生成以下错误 类型或命名空间名称出现错误1 找不到“TCPListener”(是 您缺少using指令或 装配 参考?)C:\path\WindowsService.cs 85 1

我正在使用TCPListener,根据页面,它应该在System.Net.Sockets中,我有

using System.Net;
using System.Net.Sockets;
...
TCPListener tcpListener = new TCPListener(10);
Visual Studio正在生成以下错误

类型或命名空间名称出现错误1 找不到“TCPListener”(是 您缺少using指令或 装配 参考?)C:\path\WindowsService.cs 85 13 Windows 服务测试1


我漏了什么吗?

你需要拼写正确:它是
TcpListener
,而不是
TcpListener
。C#区分大小写。

您需要正确拼写:它是
TcpListener
,而不是
TcpListener
。C#区分大小写。

它区分大小写,即TcpListener

它区分大小写,即TcpListener

尝试将代码更改为

using System.Net;
using System.Net.Sockets;
...
TcpListener tcpListener = new TcpListener(10);
C#区分大小写,TCP部分应为TCP


OneSHOT

尝试将代码更改为

using System.Net;
using System.Net.Sockets;
...
TcpListener tcpListener = new TcpListener(10);
C#区分大小写,TCP部分应为TCP


OneSHOT

如果不是智能,请使用智能感知。如果不是智能,请使用智能感知。