Example #1
0
 private static bool NeedLocalUpdate()
 {
     if (File.Exists(NotifyFilePath))
     {
         using (var reader = File.OpenText(NotifyFilePath))
         {
             return(!QuickUtilities.IsLatestVersion(Application.ProductVersion, reader.ReadToEnd().Trim()));
         }
     }
     return(false);
 }
Example #2
0
 private static bool HasUpdate(out XDocument resp, out string latestVersion)
 {
     try
     {
         resp = XDocument.Load(@"http://10.20.133.13/Download/Version.xml");
         String version = Application.ProductVersion;
         latestVersion = resp.Element("info").Element("version").Attribute("value").Value;
         return(!QuickUtilities.IsLatestVersion(version, latestVersion));
     }
     catch
     {
         //先吞掉更新失败的问题
         resp          = null;
         latestVersion = null;
         return(false);
     }
 }