示例#1
0
        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);
        }
示例#2
0
 public static void DisableCacheEntries()
 {
     if (wnsm == null)
     {
         wnsm = new WindowsNameServicesManager();
     }
     wnsm.Disable();
 }
示例#3
0
        private static DnsClient GetNonDefaultDnsClient()
        {
            var servers = WindowsNameServicesManager.GetCachedDnsServers();

            if (!servers.Any())
            {
                servers.Add(defaultDnsServer);
            }
            var client = GetClientForServers(servers);

            return(client);
        }
示例#4
0
 // 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();
 }