1
wxr
2023-03-31 7e42cc13a14b7de31c9f5d5c61cdf24f3246335d
Crabtree/SmartHome/UI/SimpleControl/Phone/System/SystemRemote.cs
@@ -159,18 +159,18 @@
        public static bool checeInternet ()
        {
            byte [] bytes = null;
            var dateTime = DateTime.Now;
            System.Threading.Tasks.Task.Run (() => {
                bytes = new System.Net.WebClient { Proxy = null }.DownloadData ("http://www.baidu.com");
            });
            while ((DateTime.Now - dateTime).TotalMilliseconds < 8000) {
                System.Threading.Thread.Sleep (100);
                if (bytes != null) {
                    return true;
                }
            }
            return false;
            //byte [] bytes = null;
            //var dateTime = DateTime.Now;
            //System.Threading.Tasks.Task.Run (() => {
            //    bytes = new System.Net.WebClient { Proxy = null }.DownloadData ("http://www.baidu.com");
            //});
            //while ((DateTime.Now - dateTime).TotalMilliseconds < 8000) {
            //    System.Threading.Thread.Sleep (100);
            //    if (bytes != null) {
            //        return true;
            //    }
            //}
            return true;
        }
        static bool ShowTip = true;