Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            NewsServiceClient newsSvc = new NewsServiceClient();
            int id = int.Parse(context.Request.QueryString["ID"]);

            byte[] imageArr = newsSvc.GetNewsPhoto(id);

            context.Response.ContentType = "image/*";
            context.Response.OutputStream.Write(imageArr, 0, imageArr.Length);
            //byte[] buffer = new byte[4096];
            // int byteSeq;
            // if (strm != null)
            //  byteSeq = strm.Read(buffer, 0, 4096);
            //else
            //  byteSeq = 0;

            //while (byteSeq > 0)
            // {
            //    context.Response.OutputStream.Write(buffer, 0, byteSeq);
            // byteSeq = strm.Read(buffer, 0, 4096);
            // }
        }