public static void checkUpdates() { if (!WebController.CheckConnection()) { MessageBox.Show((string)Application.Current.Resources["NetworkDisable"]); return; } XmlDocument docRemoteVersion = new XmlDocument(); docRemoteVersion.Load(UpdatePath.VersionPathOnServer); XmlDocument docLocalVersion = new XmlDocument(); docLocalVersion.LoadXml(File.ReadAllText("version.xml")); Version remoteVersion = new Version(docRemoteVersion.GetElementsByTagName("myprogram")[0].InnerText); Version localVersion = new Version(docLocalVersion.GetElementsByTagName("myprogram")[0].InnerText); if (localVersion < remoteVersion) { Update(); } else { MessageBox.Show((string)Application.Current.Resources["UpdateNoVersion"], (string)Application.Current.Resources["bCheckUpdate"], MessageBoxButton.OK, MessageBoxImage.Information); } }
public static void CheckUpdateSilence() { if (!WebController.CheckConnection()) { return; } XmlDocument docRemoteVersion = new XmlDocument(); docRemoteVersion.Load(UpdatePath.VersionPathOnServer); XmlDocument docLocalVersion = new XmlDocument(); docLocalVersion.LoadXml(File.ReadAllText("version.xml")); Version remoteVersion = new Version(docRemoteVersion.GetElementsByTagName("myprogram")[0].InnerText); Version localVersion = new Version(docLocalVersion.GetElementsByTagName("myprogram")[0].InnerText); if (localVersion < remoteVersion) { Update(); } }