if (NetworkInterface.GetIsNetworkAvailable()) { NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface Interface in interfaces) { if (Interface.OperationalStatus == OperationalStatus.Up) { if ((Interface.NetworkInterfaceType == NetworkInterfaceType.Ppp) && (Interface.NetworkInterfaceType != NetworkInterfaceType.Loopback)) { IPv4InterfaceStatistics statistics = Interface.GetIPv4Statistics(); MessageBox.Show(Interface.Name + " " + Interface.NetworkInterfaceType.ToString() + " " + Interface.Description); } else { MessageBox.Show("VPN Connection is lost!"); // Perform some operation } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)