开发者

iphone monotouch detect if there is an internet connection

开发者 https://www.devze.com 2022-12-20 03:40 出处:网络
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:

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

精彩评论

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