I'm using Windows XP and I want to know if the local area is available or not?
And if I'm using another OS would that affect on my code?
I'm using Windows XP and I want to know if the local area is available or not?
And if I'm using another OS would that affect on my code?
Use the following code
using System.Net.NetworkInformation; //(Add reference of System.Net.dll)
public partial class Form1: Form
{
public Form1()
{
InitializeComponent();
NetworkChange.NetworkAvailabilityChanged += NetworkChange_NetworkAvailabilityChanged;
}
private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
{
if(e.IsAvailable)
{
//connected
}
else
{
//disconnected
}
}
}
The source code for ToggleNic shows you how to enable, disable or check for available network connections on windows. This is in C#.