开发者

iphone monotouch detect if there is an internet connection

In Monotouch on an iPhone/iPo开发者_C百科d, how do I detect if there is an internet connection available?


The best way right now is to use this class from Miguel de Icaza's GitHub repository:

https://github.com/xamarin/monotouch-samples/blob/master/ReachabilitySample/reachability.cs

Its a static class with a lot of methods, so all you have to do is add it to your project and call, for example:

NetworkStatus status = Reachability.InternetConnectionStatus();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜