在iPhone / iPod上的Monotouch中,我如何检测是否有可用的互联网连接?
目前最好的方法是使用Miguel de Icaza的GitHub存储库中的这个类:
https://github.com/xamarin/monotouch-samples/blob/master/ReachabilitySample/reachability.cs
这是一个静态类,拥有许多方法,您只需要将它添加到您的项目中,并调用其中的方法,例如:
NetworkStatus status = Reachability.InternetConnectionStatus();