示例#1
0
 public static ProjectVersion GetLatestVersion()
 {
     try
     {
         WebClient webClient = new WebClient();
         webClient.DownloadFile(latestVersionXmlUrl, "LatestVersion.xml");
         return(ProjectVersion.Deserialize("LatestVersion.xml"));
     }
     catch
     {
         throw;
     }
 }
示例#2
0
 /// <summary>
 /// 判断是否第一次打开该版本
 /// </summary>
 /// <returns></returns>
 private bool FirstTimeOpen()
 {
     if (!File.Exists("localVersion.xml"))
     {
         return(true);
     }
     try
     {
         ProjectVersion lastVersion = ProjectVersion.Deserialize("localVersion.xml");
         if (lastVersion.BuildNumber < ProjectVersion.GetLocalVersion().BuildNumber)
         {
             return(true);
         }
         return(false);
     }
     catch (Exception ex)
     {
         App.writeLog.Error("判断是否第一次打开失败!", ex);
         return(false);
     }
 }