// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; using System.Xml; namespace E { public class UpdateFile { public string Name { get; set; } public string Hash { get; set; } } public class Program { public static void Main(string[] args) { List hashes = new List(); XmlReader rdr = XmlReader.Create("http://www.gamersjudgement.com/OCTGN/Hash.XML"); string name = null; string hash = null; while(rdr.Read()) { if(rdr.NodeType == XmlNodeType.Element) { if(rdr.Name == "Files") { name = ""; hash = ""; } else if(rdr.Name == "Name") { name = rdr.ReadString(); } else if(rdr.Name == "Hash") { hash = rdr.ReadString(); } } else if(rdr.NodeType == XmlNodeType.EndElement) { if(rdr.Name == "Files") { hashes.Add(new UpdateFile{ Name=name, Hash=hash }); } } } foreach(UpdateFile uf in hashes) { Console.WriteLine(uf.Name + " : " + uf.Hash); } } } }