コード例 #1
0
ファイル: Updater.cs プロジェクト: nullkuhl/fsu-dev
        /// <summary>
        /// check if app is up to date
        /// </summary>
        /// <param name="latestVerLink"></param>
        /// <returns></returns>
        public bool IsUpToDate(out string latestVerLink)
        {
            string currVersion = CfgFile.Get("Version");

            BasicHttpBinding binding = new BasicHttpBinding();
            EndpointAddress address = new EndpointAddress("http://service.freemiumlab.com/ReportService.svc");

            ReportServiceClient client = new ReportServiceClient(binding, address);
            string[] latestVersion;
            try
            {
                latestVersion = client.GetLatestVersion();
                client.Close();
            }
            catch
            {
                latestVerLink = string.Empty;
                return true;
            }
            latestVerLink = latestVersion[1];
            return latestVersion[0] == currVersion;
        }