Esempio n. 1
0
        private static async Task <bool> CheckForInternetConnection()
        {
            bool haveInternet;

            try
            {
                using (var client = new TimeoutWebClient(1000))
                {
                    using (var stream = await client.OpenReadTaskAsync(DeployProperties.MonoUrl))
                    {
                        haveInternet = true;
                    }
                }
            }
            catch
            {
                haveInternet = false;
            }

            return(haveInternet);
        }
        private static async Task<bool> CheckForInternetConnection()
        {
            bool haveInternet;
            try
            {
                using (var client = new TimeoutWebClient(1000))
                {
                    using (var stream = await client.OpenReadTaskAsync(DeployProperties.MonoUrl))
                    {
                        haveInternet = true;
                    }
                }
            }
            catch
            {
                haveInternet = false;
            }

            return haveInternet;
        }