Ejemplo n.º 1
0
        /// <summary>
        /// Checks if the launcher can access the standard HTTP changelog.
        /// </summary>
        /// <returns><c>true</c> if the changelog can be accessed; otherwise, <c>false</c>.</returns>
        public bool CanAccessStandardChangelog()
        {
            HttpWebRequest headRequest = (HttpWebRequest)WebRequest.Create(Config.GetChangelogURL());

            headRequest.Method = "HEAD";

            try
            {
                using (HttpWebResponse headResponse = (HttpWebResponse)headRequest.GetResponse())
                {
                    return(headResponse.StatusCode == HttpStatusCode.OK);
                }
            }
            catch (WebException wex)
            {
                Log.Warn("Could not access standard changelog (WebException): " + wex.Message);
                return(false);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Checks if the launcher can access the standard HTTP changelog.
        /// </summary>
        /// <returns><c>true</c> if the changelog can be accessed; otherwise, <c>false</c>.</returns>
        public bool CanAccessStandardChangelog()
        {
            HttpWebRequest headRequest = (HttpWebRequest)WebRequest.Create(Config.GetChangelogURL());

            headRequest.Method = "HEAD";

            try
            {
                using (HttpWebResponse headResponse = (HttpWebResponse)headRequest.GetResponse())
                {
                    return(headResponse.StatusCode == HttpStatusCode.OK);
                }
            }
            catch (WebException wex)
            {
                Console.WriteLine("WebException in CanAcessStandardChangelog(): " + wex.Message);
                return(false);
            }
        }