Ian*_*ink 3 iphone connection xamarin.ios
在iPhone/iPod上的Monotouch中,如何检测是否有可用的互联网连接?
现在最好的方法是使用Miguel de Icaza的GitHub存储库中的这个类:
https://github.com/xamarin/monotouch-samples/blob/master/ReachabilitySample/reachability.cs
它是一个带有很多方法的静态类,所以你要做的就是将它添加到你的项目并调用,例如:
NetworkStatus status = Reachability.InternetConnectionStatus();
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2211 次 |
最近记录: |