fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Net;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. List<ipFound> ipList = new List<ipFound>();
  10.  
  11. ipList.Add(new ipFound { ipAddress = IPAddress.Parse("127.0.0.1") });
  12. ipList.Add(new ipFound { ipAddress = IPAddress.Parse("168.193.10.1") });
  13.  
  14. IPAddress srcIP = IPAddress.Parse("127.0.0.1");
  15.  
  16. ipFound ipTemp = ipList.Find(x => x.ipAddress.Equals(srcIP));
  17.  
  18. Console.WriteLine(ipTemp.ipAddress.ToString());
  19. }
  20. }
  21.  
  22. public class ipFound
  23. {
  24. public System.Net.IPAddress ipAddress;
  25. public int bytesSent;
  26. public int bytesReceived;
  27. public int bytesTotal;
  28. }
Success #stdin #stdout 0.04s 34032KB
stdin
Standard input is empty
stdout
127.0.0.1