Hi,
I'm using the following code to check if there is a connection to the
internet:
#region
//Creating the extern function...
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState(out int
Description, int ReservedValue);
#endregion
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int Desc;
bool res = InternetGetConnectedState(out Desc, 0);
Console.WriteLine("Inet is up: " + res);
}
The strange thing is that it always returns false, even as I am
writing this message and while browsing the web.
I am connected to the internet via LAN in my company. Maybe this
function is more aimed at modem users ?
Is there any clarification for this ?
Thanks,
JB