的TCPListener从System.Net.Sockets命名空间缺少
问题描述:
我使用的TCPListener它根据this页面应该在的System.Net.Sockets,我有的TCPListener从System.Net.Sockets命名空间缺少
using System.Net;
using System.Net.Sockets;
...
TCPListener tcpListener = new TCPListener(10);
Visual Studio是产生以下错误
错误1类型或命名空间名称 '的TCPListener' 找不到(?是 你缺少using指令或 装配 参考)C:\路径\ WindowsService.cs 85级13的Windows 服务测试1
我错过了什么吗?
答
你需要正确拼写它:它的TcpListener
,而不是TCPListener
。 C#区分大小写。
答
这是大小写敏感的,即的TcpListener
答
试着改变你的代码
using System.Net;
using System.Net.Sockets;
...
TcpListener tcpListener = new TcpListener(10);
C#是区分大小写和TCP段应该是TCP协议。
HTH
ONESHOT
FFS ....不是一个好办法,开始新的一天......想我还需要更多的咖啡 – UnkwnTech 2009-06-15 13:20:44