File Directory ASP.Net Tutorial

<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.IO.Compression" %>


    protected void Page_Load(object sender, EventArgs e)
    {
        string filename = Server.MapPath("Data.zip");
        FileStream infile = File.OpenRead(filename);
        DeflateStream deflateStream = new DeflateStream(infile, CompressionMode.Decompress);
        byte[] buffer = new byte[infile.Length + 100];
        int offset = 0;
        int totalCount = 0;
        while (true)
        {
            int bytesRead = deflateStream.Read(buffer, offset, 100);
            if (bytesRead == 0)
            { break; }
            offset += bytesRead;
            totalCount += bytesRead;
        }
        FileStream outfile = File.Create(Path.ChangeExtension(filename, "txt"));
        outfile.Write(buffer, 0, buffer.Length);
        outfile.Close();
    }



    Untitled Page