Password Protected Excel Download using EPPLUS

前端 未结 4 668

I am exporting data in Excel form using EPPLUS Excel Library. I want that when excel downloaded it will ask for password. I have tried following code.

4条回答
  •  自闭症患者
    2021-01-02 21:47

    If you are saving the excel package into a MemoryStream (for sending as an email attachment) you have to do this:

    excelPackage.SaveAs(memoryStream, "pa$$w0rd");
    

提交回复
热议问题