Get notified when internet is connected or disconnected

前端 未结 1 966
滥情空心
滥情空心 2021-02-06 13:41

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

1条回答
  •  醉梦人生
    2021-02-06 14:19

    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:

    enter image description here

    Then just you can follow the example from the link, is really short and direct to the point.

    0 讨论(0)
提交回复
热议问题