static void Main(string[] args) { MultiTextWriter m_MultiConOut; Console.SetOut(m_MultiConOut = new MultiTextWriter(Console.Out, new FileLogger(outFile, append: false))); Console.WriteLine("OS Version {0} : {1}", System.Environment.OSVersion, WindowsNameServicesManager.GetWindowsVersion()); using (m_MultiConOut) { try { var wnms = new WindowsNameServicesManager(); var moc = WindowsNameServicesManager.GetNetworkConfigs(); foreach (ManagementObject mo in moc) { if ((bool)mo["IPEnabled"]) { Console.WriteLine(); Console.WriteLine(mo["Description"]); Console.WriteLine("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); WindowsNameServicesManager.DumpInterfaceProps(mo); } } } catch (Exception ex) { Console.WriteLine(ex); } } Console.WriteLine("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n"); Console.WriteLine("\n\nRegistry Info:"); WriteRegistryInterfaces(); System.Diagnostics.Process.Start("notepad.exe", outFile); }
public static void DisableCacheEntries() { if (wnsm == null) { wnsm = new WindowsNameServicesManager(); } wnsm.Disable(); }
private static DnsClient GetNonDefaultDnsClient() { var servers = WindowsNameServicesManager.GetCachedDnsServers(); if (!servers.Any()) { servers.Add(defaultDnsServer); } var client = GetClientForServers(servers); return(client); }
// GET api/Monitor // GET api/Monitor/5 public dynamic Get(int?id = null) { return(new ApiMonitorResponse() { Nmc = Monitor.NameCoinOnline, Ns = Monitor.NameServerOnline, CacheHook = WindowsNameServicesManager.AnyDotBitCacheConfigKeys(), LastBlockTime = Monitor.LastBlockTimeGMT, Logging = Program.LoggingEnabled, LogFolder = System.IO.Directory.Exists(Program.LogFolder) ? Program.LogFolder : null, Version = Program.Version.ToString() }); }
public static void DisableCacheEntries() { if(wnsm==null) wnsm=new WindowsNameServicesManager(); wnsm.Disable(); }