Exemplo n.º 1
0
        private void OnDnsChanging(bool sendDnsChangeEvents)
        {
            Process process = new Process();

            process.StartInfo = new ProcessStartInfo("ipconfig", "/flushdns");
            process.Start();
            process.Exited += (sender, e) =>
            {
                if (sendDnsChangeEvents)
                {
                    DnsChanged?.Invoke(process.ExitCode == 0);
                }
            };
        }
Exemplo n.º 2
0
 protected virtual void OnDnsChanged()
 {
     FlushDns();
     DnsChanged?.Invoke(this, EventArgs.Empty);
 }