// 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.IO; using System.Net; namespace E { class MainClass { public static void Main(string[] args) { try { HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://www.scanmaps.dk/"); wr.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50215)"; wr.CookieContainer = new CookieContainer(); string html = (new StreamReader(wr.GetResponse().GetResponseStream())).ReadToEnd(); Console.WriteLine(html); } catch(WebException ex) { Console.WriteLine(ex); } } } }