public static ProjectVersion GetLatestVersion() { try { WebClient webClient = new WebClient(); webClient.DownloadFile(latestVersionXmlUrl, "LatestVersion.xml"); return(ProjectVersion.Deserialize("LatestVersion.xml")); } catch { throw; } }
/// <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); } }