// 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; using System.Net.Sockets; using System.Text; namespace E { public class Program { public static void Main(string[] args) { HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://gameusd.com/index.php?action=game.showhost&hostid=1218"); req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"; req.Accept = "image/gif, image/x-xbitmap, image/jpeg, application/x-shockwave-flash, */*"; req.Headers.Add("Accept-Language", "en-us"); req.Headers.Add("Accept-Encoding", "gzip, deflate"); WebResponse resp = req.GetResponse(); StreamReader sr = new StreamReader(resp.GetResponseStream(), Encoding.UTF8); string json = sr.ReadToEnd(); sr.Close(); resp.Close(); Console.WriteLine(json); } } }