// 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.IO.Compression; using System.Net; using System.Web; public class MainClass { public static void Main(string[] args) { HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://localhost/z.php.gz"); Stream stm = wr.GetResponse().GetResponseStream(); GZipStream gzstm = new GZipStream(stm, CompressionMode.Decompress); StreamReader sr = new StreamReader(gzstm); string line; while((line = sr.ReadLine()) != null) { Console.WriteLine(line); } sr.Close(); gzstm.Close(); stm.Close(); } }