Convert excel workbook to byte[]

前端 未结 2 423
挽巷
挽巷 2021-01-21 07:22

I have an \"excel library\" workbook and want to convert it to a byte[] so I could return the data with the File method exist in asp.net mvc controller.
There are \"Save\" a

2条回答
  •  走了就别回头了
    2021-01-21 08:09

    If you have a SaveToStream you could pass in a MemoryStream into that method. Then, once all the bytes are written call ToArray() on the memory stream, which should give you a byte array.

提交回复
热议问题