using System; using System.IO; using System.Linq; using System.Net; using System.Net.NetworkInformation; using System.Text; class Program { static void Main() { StreamReader sr = new StreamReader(@"C:\Users\****\Desktop\iplist.txt", Encoding.Default); String line; while ((line = sr.ReadLine()) != null) { if (!IsWindows(line.ToString())) { Console.WriteLine(line.ToString()); } } } public static bool IsWindows(string strIP) { bool bResult = false; try { Ping p = new Ping(); PingReply pr = p.Send(strIP, 500); if (pr != null && pr.Status == IPStatus.Success) { int iTTL = pr.Options.Ttl; bResult = (iTTL > 64); } } catch (Exception ex) { } return bResult; } }