The page is written as an Excel file

xiaoxiao2021-03-05  26

Stream RequestStream; BinaryReader Br; BYTE [] Bytedata; long datalent = request.inputstream.length;

BYTEDATA = New byte [DataLen]; RequestStream = Request.InputStream; br = new binaryreader (RequestStream);

Br.read (Bytedata, 0, (INT) DATALEN;

br.Close (); requestStream.Close (); Response.ClearContent (); Response.ClearHeaders (); Response.ContentEncoding = System.Text.Encoding.UTF8; Response.ContentType = "application / vnd.ms-excel";

Response.addheader ("Content-Disposition", "Inline / attachment; filename = Test.xls"); response.binaryWrite (Bytedata); / summary is enough. Please take the status of the view of the page at the same time.

转载请注明原文地址:https://www.9cbs.com/read-35918.html

New Post(0)