asp.net webform download excel

private void exportBinaryToExcel(byte[] bytes, string filename)

{

    Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);

    Response.AddHeader("Content-Length", bytes.Length.ToString());

    Response.ContentType = "application/octet-stream";

    Response.BinaryWrite(bytes);

    Response.Flush();

}

 

你可能感兴趣的:(download)