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

后端 未结 27 2014
感动是毒
感动是毒 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:43

    A test for internet connection by pinging Google:

    new Ping().Send("www.google.com.mx").Status == IPStatus.Success
    

提交回复
热议问题