private static IEnumerable <Connection> ParseNetFile(string filename, string type, ProcessOverview overview) { FileInfo f = new FileInfo(filename); if (!f.Exists) { yield break; } var reader = new StreamReader(f.OpenRead()); var header = reader.ReadLine(); while (!reader.EndOfStream) { var line = reader.ReadLine(); if (String.IsNullOrWhiteSpace(line)) { continue; } var parts = Regex.Split(line, @"\s+"); var uid = int.Parse(parts [8]); var source = ParseHexEndpoint(parts [2]); var dest = ParseHexEndpoint(parts [3]); var packets = long.Parse(parts [5].Split(':')[1], System.Globalization.NumberStyles.HexNumber); if (_skipSourceIps.Contains(dest.Address)) { continue; } var c = new Connection(); c.Source = source; c.Destination = dest; c.Activity = packets; c.Program = overview.FromId(uid); c.Type = type; yield return(c); } }