【问题标题】:Check Internet connection reachability in xamarin forms检查 xamarin 表单中的 Internet 连接可访问性
【发布时间】:2017-11-23 05:18:40
【问题描述】:

我正在使用 https://github.com/jamesmontemagno/ConnectivityPlugin 插件检查我的 xamarin 表单移动应用程序中的互联网连接可达性。但是加载需要一些时间。有什么办法可以减少加载时间?

       if (CrossConnectivity.Current.IsConnected)
       {
           if (await CrossConnectivity.Current.IsRemoteReachable(new Uri("https://www.google.lk/").Authority))
           {
               //do some thing
           }
           else
           {
              //connection is not reachable
           }
       }

【问题讨论】:

  • 欢迎。请不要发布代码截图。 How to Ask。祝你好运
  • 它可能会在后台加载整个页面以确定它是否可以访问,因此减少加载时间的唯一方法可能是选择更轻的网站。

标签: c# xamarin.forms


【解决方案1】:

请参阅以下博客的第 2 步:如何从 Xamarin.Forms 应用程序检查网络状态? https://bsubramanyamraju.blogspot.in/2017/04/xamarinforms-consuming-rest-webserivce_17.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-11-18
    • 1970-01-01
    • 1970-01-01
    • 2018-04-01
    • 2019-06-09
    • 2019-09-15
    相关资源
    最近更新 更多