I have a desktop application in WPF and C# developed under the .Net 4.0 Client Framework that has to show or hide some data according to if internet is available or not on the
William Riley pointed me to this link, which helped me to find the way to do it.
Finally I come to the point using the Network List Manager from the Windows API through the COM implementation from Microsoft. (you can check some examples)
It is important to add the correct reference to the project:
Then just you can follow the example from the link, is really short and direct to the point.