I tried to find the answer, but I failed. When Internet connection is not available the icon on the Window's notification area has yellow mark. When Internet becomes available the a yellow mark disappears. I want to get notified at that moment.
The following is only for Ethernet connection, not actual Internet availability. I need a event to detect Internet connect/disconnect
I could not find how to use NetworkInformation.NetworkStatusChanged
in WinForms.
Other than constantly pinging some web site myself, is there a cleaner solution? All the answers I found were old. The OS must already know whether Internet is available or not, because it changed the notification area icon. How can I get that information from the OS?
I am using .NET Framework 4.7.
It seems my question would be closed. But this is not a duplicate of that, because that question was checking for Internet, and mine is getting notified at the moment.