我正在使用 LINQ .Find()
,它在找到匹配项时并没有停止。我有:
List<ipFound> ipList = new List<ipFound>();
ipFound ipTemp = ipList.Find(x => x.ipAddress == srcIP);
if (ipTemp == null) {
// this is always null
}
public class ipFound
{
public System.Net.IPAddress ipAddress;
public int bytesSent;
public int bytesReceived;
public int bytesTotal;
}
有任何想法吗?我要疯了。
谢谢!