【发布时间】:2009-06-26 08:42:41
【问题描述】:
执行时此行显示错误:
((IPEndPoint)(TcpClient.Client.RemoteEndPoint)).Address;
错误是:
An object reference is required for the nonstatic field, method, or property
System.Net.Sockets.TcpClient.Client.get ...
这个错误有什么解决办法?
代码如下所示。
//Assume myList is an ArrayList
IPAddress tempAddress = ((IPEndPoint)(TcpClient.Client.RemoteEndPoint)).Address;
myList.Add(tempAddress);
【问题讨论】:
-
您要检索的 IP 地址是什么? ...本地机器?
标签: c# ip-address