What is the best way to check for Internet connectivity using .NET?

后端 未结 27 2355
感动是毒
感动是毒 2020-11-22 07:41

What is the fastest and most efficient way to check for Internet connectivity in .NET?

27条回答
  •  悲哀的现实
    2020-11-22 08:18

    If you want to notify the user/take action whenever a network/connection change occur.
    Use NLM API:

    • https://msdn.microsoft.com/en-us/library/ee264321.aspx

    • http://www.codeproject.com/Articles/34650/How-to-use-the-Windows-NLM-API-to-get-notified-of

提交回复
热议问题