C
coolram4u
Guest
Hi All,
Iam working VB2008 windows application where the application needs to recognise when the network is down and connected. For this i was using NetworkAvailabilityChanged event which initially recognises the network availability.It is working fine exactly when only one Network Interface is enabled. But the NetworkAvailabilityChanged event not even firing when a VPN network interface is also enabled along with my LAN network Interface which means multiple network interfaces are enabled. Please do find the code below and help me on the same if ther is any way to get the event fired :
using System.Net.NetworkInformation;
namespace NetworkTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
NetworkChange.NetworkAvailabilityChanged += AvailabilityChanged;
}
private void AvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
{
if (e.IsAvailable)
MessageBox.Show("Network connected!");
else
MessageBox.Show("Network disconnected!");
}
}
}
Thanks,
Ram
ram
Continue reading...
Iam working VB2008 windows application where the application needs to recognise when the network is down and connected. For this i was using NetworkAvailabilityChanged event which initially recognises the network availability.It is working fine exactly when only one Network Interface is enabled. But the NetworkAvailabilityChanged event not even firing when a VPN network interface is also enabled along with my LAN network Interface which means multiple network interfaces are enabled. Please do find the code below and help me on the same if ther is any way to get the event fired :
using System.Net.NetworkInformation;
namespace NetworkTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
NetworkChange.NetworkAvailabilityChanged += AvailabilityChanged;
}
private void AvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
{
if (e.IsAvailable)
MessageBox.Show("Network connected!");
else
MessageBox.Show("Network disconnected!");
}
}
}
Thanks,
Ram
ram
Continue reading...