public void UpdateFirebwallMetaVersion() { try { WebClient client = new WebClient(); client.Headers[HttpRequestHeader.UserAgent] = "firebwall 0.3.11.0 Updater"; XmlTextReader reader = new XmlTextReader("https://www.firebwall.com/api/firebwall/" + LanguageConfig.GetCurrentTwoLetter() + ".xml"); lock (padlock) { if (!reader.Read()) { availableFirebwall = null; reader.Close(); return; } availableFirebwall = new fireBwallMetaData(); while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: if (reader.Name == "current") { availableFirebwall.version = reader.GetAttribute("version"); } else if (reader.Name == "filename") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) availableFirebwall.filename = reader.Value; } else if (reader.Name == "description") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) availableFirebwall.Description = reader.Value; } else if (reader.Name == "entry") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) availableFirebwall.changelog.Add(reader.Value); } else if (reader.Name == "downloadurl") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) availableFirebwall.downloadUrl = reader.Value; } else if (reader.Name == "imageurl") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) availableFirebwall.imageUrl = reader.Value; } else if (reader.Name == "url") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) { availableFirebwall.screenShotUrls.Add(reader.Value); } } break; } } } } catch { } }
public void UpdateFirebwallMetaVersion() { try { WebClient client = new WebClient(); client.Headers[HttpRequestHeader.UserAgent] = "firebwall 0.3.11.0 Updater"; XmlTextReader reader = new XmlTextReader("https://www.firebwall.com/api/firebwall/" + LanguageConfig.GetCurrentTwoLetter() + ".xml"); lock (padlock) { if (!reader.Read()) { availableFirebwall = null; reader.Close(); return; } availableFirebwall = new fireBwallMetaData(); while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: if (reader.Name == "current") { availableFirebwall.version = reader.GetAttribute("version"); } else if (reader.Name == "filename") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) { availableFirebwall.filename = reader.Value; } } else if (reader.Name == "description") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) { availableFirebwall.Description = reader.Value; } } else if (reader.Name == "entry") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) { availableFirebwall.changelog.Add(reader.Value); } } else if (reader.Name == "downloadurl") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) { availableFirebwall.downloadUrl = reader.Value; } } else if (reader.Name == "imageurl") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) { availableFirebwall.imageUrl = reader.Value; } } else if (reader.Name == "url") { reader.Read(); if (reader.NodeType == XmlNodeType.Text) { availableFirebwall.screenShotUrls.Add(reader.Value); } } break; } } } } catch { } }